{"id":430877,"date":"2021-04-18T10:13:07","date_gmt":"2021-04-18T02:13:07","guid":{"rendered":"http:\/\/4563.org\/?p=430877"},"modified":"2021-04-18T10:13:07","modified_gmt":"2021-04-18T02:13:07","slug":"celery-%e5%a6%82%e4%bd%95%e9%80%9a%e8%bf%87-task_id-%e6%9f%a5%e8%af%a2%e4%bb%bb%e5%8a%a1%e7%9a%84%e6%89%a7%e8%a1%8c%e6%97%a5%e5%bf%97","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=430877","title":{"rendered":"celery \u5982\u4f55\u901a\u8fc7 task_id \u67e5\u8be2\u4efb\u52a1\u7684\u6267\u884c\u65e5\u5fd7"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  celery \u5982\u4f55\u901a\u8fc7 task_id \u67e5\u8be2\u4efb\u52a1\u7684\u6267\u884c\u65e5\u5fd7               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Alexf4 <\/span>  <span><i><\/i> 12<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6700\u8fd1\u5728\u4f7f\u7528 celery \u505a\u4efb\u52a1\u961f\u5217\uff0c\u7528 flower \u5df2\u7ecf\u53ef\u4ee5\u6ee1\u8db3\u67e5\u770b\u67d0\u4e2a\u4efb\u52a1\u7684\u6267\u884c\u72b6\u6001\uff0c\u53c2\u6570\uff0c\u65f6\u95f4\u7b49\u7b49\u3002 <\/p>\n<p>\u540e\u9762\u60f3\u7740\u5b9a\u5236\u9700\u6c42\uff1a\u901a\u8fc7\u4e00\u4e2a <code>task_id<\/code> \u5b9e\u65f6\u67e5\u770b\u6267\u884c\u7684\u60c5\u51b5\uff08\u7c7b\u4f3c\u4efb\u52a1\u6267\u884c\u91cc\u9762\u7684 print, logger \u7b49\uff09\uff0c\u5404\u4f4d\u5927\u4f6c\u4eec\u6709\u6ca1\u6709\u5efa\u8bae\uff1f<\/p>\n<p>\u76ee\u524d\u81ea\u5df1\u7684\u5927\u6982\u7684\u60f3\u6cd5\uff1a<\/p>\n<ul>\n<li>\u5728\u6bcf\u4e2a <code>worker<\/code> \u7684\u6267\u884c\u65e5\u5fd7\u91cc\u9762\u64cd\u4f5c\uff0c\u505a\u8fd1\u5b9e\u65f6\u7684\u6536\u96c6\uff08 collectd, fluentd, filebeat \u7b49\uff09\uff0c\u7136\u540e\u6839\u636e <code>task_id<\/code> \u5728\u65e5\u5fd7\u7684\u4ed3\u5e93\uff08 clickhouse, es \uff09\u505a\u67e5\u8be2\u3002\u8fd9\u4e2a\u65e5\u5fd7\u641c\u7d22\u4f1a\u6709\u4e00\u5b9a\u7684\u5ef6\u8fdf\u6027<\/li>\n<li>\u6bcf\u4e2a task \u914d\u7f6e\u4e00\u4e2a\u5355\u72ec\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c \u7136\u540e\u5728\u8fdb\u884c\u67e5\u8be2\u65f6\u5019\uff0c \u5229\u7528 websocket \u8fde\u63a5\u670d\u52a1\u5668\uff08\u6b64\u65f6\u670d\u52a1\u5668\u627e\u5230\u5bf9\u5e94\u7684\u6587\u4ef6\uff0c <code>tail -f <\/code>\uff09\u3002<\/li>\n<\/ul><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>2<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5643798\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : strict <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7b80\u5355\u7c97\u66b4,\u628a\u65e5\u5fd7\u5173\u952e\u6570\u636e\u585e\u5230 result backend \u4e2d.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5643799\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Alexf4 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @strict \u8fd9\u4e2a\u53ea\u662f\u4fdd\u5b58\u4efb\u52a1\u7684\u4e00\u4e9b\u5fc5\u8981\u53c2\u6570\u5427\u3002\u6267\u884c\u7ed3\u679c\uff0c\u53c2\u6570\uff0c\u6267\u884c\u65f6\u95f4\u7b49\u7b49\u3002<br \/>\u4f46\u662f\u50cf\u6267\u884c\u65e5\u5fd7\uff0c\u7c7b\u4f3c\u4efb\u52a1 stdout \u8f93\u51fa\uff0c \u4e0d\u4f1a\u5728\u8fd9\u91cc\u9762\u5427\uff1f\u8fd8\u662f\u6709\u5565\u76f2\u70b9\u6211\u6ca1\u53d1\u73b0\u7684\u5417\uff0c\u534e\u751f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>celery \u5982\u4f55\u901a\u8fc7 task_&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/430877"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=430877"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/430877\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=430877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=430877"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=430877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}