SJA APS后端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
575 B

  1. package Engine
  2. import (
  3. conf "leit.com/leit_seat_aps/config"
  4. "leit.com/leit_seat_aps/db"
  5. "leit.com/leit_seat_aps/glog"
  6. )
  7. // 启动保存服务
  8. // 同时通过协程从该管道中收取已完成的打印任务更新到数据库中
  9. func StartSaver(conf *conf.EnvConfig,c chan db.PrintTask) {
  10. go func() {
  11. for {
  12. // 从管道获取要保存的任务
  13. task := <-c
  14. // 关闭打印任务
  15. m := new(db.PrintTask)
  16. err := m.ChangePrintTaskStatus(task, "C")
  17. if err != nil {
  18. glog.InfoExtln("Printer","Failed to close the print task :", task)
  19. }
  20. }
  21. }()
  22. }