{"id":112250,"date":"2020-02-12T06:00:04","date_gmt":"2020-02-11T22:00:04","guid":{"rendered":"http:\/\/4563.org\/?p=112250"},"modified":"2020-02-12T06:00:04","modified_gmt":"2020-02-11T22:00:04","slug":"%e5%a6%82%e4%bd%95%e4%bc%98%e9%9b%85%e7%9a%84%e5%9c%a8-flask-%e5%88%9d%e5%a7%8b%e5%8c%96-app-%e6%97%b6%e6%8f%90%e4%ba%a4%e4%b8%80%e4%b8%aa%e5%90%8e%e5%8f%b0%e4%bb%bb%e5%8a%a1%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=112250","title":{"rendered":"\u5982\u4f55\u4f18\u96c5\u7684\u5728 FLASK \u521d\u59cb\u5316 app \u65f6\u63d0\u4ea4\u4e00\u4e2a\u540e\u53f0\u4efb\u52a1\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5982\u4f55\u4f18\u96c5\u7684\u5728 FLASK \u521d\u59cb\u5316 app \u65f6\u63d0\u4ea4\u4e00\u4e2a\u540e\u53f0\u4efb\u52a1\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Latin <\/span>  <span><i><\/i> 56<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h3>\u76ee\u524d\u505a\u6cd5\u662f\u8fd9\u6837\uff0c\u8bf7\u5404\u4f4d\u5927\u4f6c\u6307\u6559\u3002<\/h3>\n<pre><code>thread_lock = Lock() thread = None  def create_app():     ...     register_consumer(app)     return app           def register_consumer(app):     global thread     if not app.debug:         with thread_lock:             executor = ThreadPoolExecutor(1)             thread = executor.submit(alarmHandle, app) <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"258020\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : renmu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             before_first_request \u88c5\u9970\u5668                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"258021\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Latin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @renmu \u5c31\u662f\u4e3a\u4e86\u907f\u514d\u8bf7\u6c42\u89e6\u53d1                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"258022\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wzwwzw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u8981\u7528 gunicorn \u7684\u8bdd\u8981\u907f\u514d\u591a\u6b21\u542f\u52a8\u8fd9\u4e2a\u7ebf\u7a0b\u3002<br \/>\u6211\u76ee\u524d\u7684\u505a\u6cd5\u662f\u7ed1\u5b9a\u4e00\u4e2a\u7aef\u53e3\uff0c\u542f\u52a8 apscheduler \u548c \u4e00\u4e9b\u5176\u4ed6\u7684\u7ebf\u7a0b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"258023\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Latin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wzwwzw \u4e3b\u8981\u8fd9\u662f\u4e2a\u6d88\u8cbb\u4efb\u52a1\uff0c\u4e0d\u60f3\u653e\u5728 celery \u6216\u8005 apscheduler \u5185\u8dd1\u5b9a\u65f6 job                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"258024\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 15399905591 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u7528 uwsgi \u7684\u8bdd\uff0c\u5355\u72ec\u6302\u8f7d\u4e00\u4e2a mule                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f18\u96c5\u7684\u5728 FLASK \u521d\u59cb\u5316 &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\/112250"}],"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=112250"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/112250\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112250"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}