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.

31 lines
1.2KB

  1. # -*-coding:utf-8 -*-
  2. from enums.StatusEnum import StatusType
  3. from util.QueUtil import put_queue
  4. from util.TimeUtils import now_date_to_str
  5. def push_result(fb_queue, errorCode="", errorMsg="", status=StatusType.RUNNING.value[0]):
  6. put_queue(fb_queue, ('stream',
  7. {
  8. "errorCode": errorCode,
  9. "errorMsg": errorMsg,
  10. "status": status,
  11. "currentTime": now_date_to_str()
  12. }),
  13. timeout=2)
  14. def push_http_result(fb_queue, callback_url=None, errorCode="", errorMsg="", status=StatusType.RUNNING.value[0]):
  15. if callback_url is not None:
  16. put_queue(fb_queue, ('stream',
  17. {
  18. "callback_url": callback_url,
  19. "data": {
  20. "errorCode": errorCode,
  21. "errorMsg": errorMsg,
  22. "status": status,
  23. "currentTime": now_date_to_str()
  24. }
  25. }),
  26. timeout=2)