{"id":199855,"date":"2020-11-10T09:11:33","date_gmt":"2020-11-10T01:11:33","guid":{"rendered":"http:\/\/4563.org\/?p=199855"},"modified":"2020-11-10T09:11:33","modified_gmt":"2020-11-10T01:11:33","slug":"celery5-0-%e5%ae%9a%e6%9c%9f%e4%bb%bb%e5%8a%a1%e7%9a%84%e9%87%8d%e5%90%af%e5%92%8c%e5%8a%a8%e6%80%81%e6%b7%bb%e5%8a%a0%e5%92%8c%e5%88%a0%e9%99%a4%e7%9a%84%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=199855","title":{"rendered":"Celery5.0 \u5b9a\u671f\u4efb\u52a1\u7684\u91cd\u542f\u548c\u52a8\u6001\u6dfb\u52a0\u548c\u5220\u9664\u7684\u5b9e\u73b0"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Celery5.0 \u5b9a\u671f\u4efb\u52a1\u7684\u91cd\u542f\u548c\u52a8\u6001\u6dfb\u52a0\u548c\u5220\u9664\u7684\u5b9e\u73b0               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sunhk25 <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\uff11\uff0e\u901a\u8fc7 Python \uff08 Flask \uff09\u542f\u52a8\uff0c\u4f46\u662f\u4e0d\u77e5\u9053\u5982\u4f55\u91cd\u542f\uff08\u60f3\u5230\u7684\u662f\u901a\u8fc7\u8fdb\u7a0b\u540d\u5f3a\u5236\u5173\u95ed\u540e\u518d\u542f\u52a8\uff09<\/p>\n<pre><code>subprocess.Popen(['celery', '-A', 'vextia.celery', 'beat', '-s', 'temp\/celerybeat-schedule']) <\/code><\/pre>\n<p>\uff12\uff0e\u5982\u679c\u60f3\u901a\u8fc7\u753b\u9762\u6765\u7ba1\u7406\u5b9a\u65f6\u4efb\u52a1\u7684\u8bdd\uff0c\u5982\u4f55\u6dfb\u52a0\u548c\u5220\u9664\u4efb\u52a1<\/p>\n<ul>\n<li>\u53c2\u8003\u5b98\u65b9\u6587\u6863\uff0c\u521d\u59cb\u5316\u65f6\u53ef\u4ee5\u5b9e\u73b0\u6dfb\u52a0\u5b9a\u65f6\u4efb\u52a1<\/li>\n<\/ul>\n<p>https:\/\/docs.celeryproject.org\/en\/latest\/userguide\/periodic-tasks.html#entries<\/p>\n<ul>\n<li>Celery5.0 \u597d\u50cf\u5b9e\u73b0\u4e86 django \u7684\u7c7b\u4f3c\u52a8\u6001\u7ba1\u7406\u529f\u80fd\uff0c\u4e0d\u77e5\u6709\u4ec0\u4e48\u597d\u5efa\u8bae\u3002 https:\/\/stackoverflow.com\/questions\/10194975\/how-to-dynamically-add-remove-periodic-tasks-to-celery-celerybeat\/55603127#55603127<\/li>\n<\/ul><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4268864\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : a719114136 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3a\u5565\u8981\u901a\u8fc7 flask \u542f\u52a8\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4268865\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sunhk25 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @a719114136 <br \/>\u5f00\u53d1\u9636\u6bb5\u56fe\u7701\u4e8b \u8ddf\u5e94\u7528\u4e00\u5757\u542f\u52a8                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4268866\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nonduality <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 supervisor \u7ba1\u7406 celery \u8fdb\u7a0b\uff0c\u522b\u7528 subprocess \u6216 shell \u811a\u672c\u3002\u52a8\u6001\u589e\u5220 celery \u4efb\u52a1\u53ef\u4ee5\u53c2\u8003 celery-beat \u7684\u4ee3\u7801\uff0c\u6211\u57fa\u4e8e celery-beat \u7684 model \u548c api \u5b9e\u73b0\u8fc7\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4268867\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sunhk25 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nonduality <br \/>\u8c22\u8c22\u5efa\u8bae\uff0csupervisor \u770b\u6837\u5b50\u4e0d\u9519\uff0c\u9700\u8981 Linux \u5bb9\u5668\u6765\u5f00\u53d1<br \/>\u52a8\u6001\u589e\u5220\u770b\u6765\u8fd8\u662f\u6ca1\u6709\u592a\u7b80\u5355\u65b9\u4fbf\u7684\u65b9\u6cd5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4268868\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fhsan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u55ef\uff0cdjango-celery-beat                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4268869\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Macv1994 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ef\u4ee5\u8003\u8651 flask-apscheduler                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4268870\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sunhk25 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Macv1994 \u73b0\u5728\u770b\u8d77\u6765 flask-apscheduler \u5b9a\u65f6\u4efb\u52a1\u7ba1\u7406\u65b9\u4fbf\u4e9b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Celery5.0 \u5b9a\u671f\u4efb\u52a1\u7684\u91cd\u542f&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\/199855"}],"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=199855"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/199855\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=199855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=199855"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=199855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}