{"action":"created","issue":{"url":"https://api.github.com/repos/mher/tornado-celery/issues/58","labels_url":"https://api.github.com/repos/mher/tornado-celery/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/mher/tornado-celery/issues/58/comments","events_url":"https://api.github.com/repos/mher/tornado-celery/issues/58/events","html_url":"https://github.com/mher/tornado-celery/issues/58","id":121633525,"number":58,"title":"blocked at  yield tornado.gen.Task(tasks.build_theme_release_apk.apply_async,args=[])","user":{"login":"pleasurelong","id":5343674,"avatar_url":"https://avatars.githubusercontent.com/u/5343674?v=3","gravatar_id":"","url":"https://api.github.com/users/pleasurelong","html_url":"https://github.com/pleasurelong","followers_url":"https://api.github.com/users/pleasurelong/followers","following_url":"https://api.github.com/users/pleasurelong/following{/other_user}","gists_url":"https://api.github.com/users/pleasurelong/gists{/gist_id}","starred_url":"https://api.github.com/users/pleasurelong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleasurelong/subscriptions","organizations_url":"https://api.github.com/users/pleasurelong/orgs","repos_url":"https://api.github.com/users/pleasurelong/repos","events_url":"https://api.github.com/users/pleasurelong/events{/privacy}","received_events_url":"https://api.github.com/users/pleasurelong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-11T04:04:34Z","updated_at":"2016-01-24T10:14:32Z","closed_at":null,"body":"# -*- coding: utf-8 -*-\r\nimport tornado.gen\r\nimport os\r\nimport time\r\nfrom _base import BaseHandler\r\nfrom config import settings\r\nimport tasks\r\nimport tcelery\r\ntcelery.setup_nonblocking_producer()\r\n\r\n\r\nclass SourceUploadHandler(BaseHandler):\r\n    # @tornado.web.asynchronous\r\n    @tornado.gen.coroutine\r\n    def post(self, *args, **kwargs):\r\n        appName = self.get_argument('appName', 'xxx')\r\n        package = self.get_argument('package', 'com.xx.xx')\r\n        versionCode = self.get_argument('versionCode', 1)\r\n        versionName = self.get_argument('versionName', '1.2.1')\r\n        scaleFactor = self.get_argument('scaleFactor', 1)\r\n        files = self.request.files['resource']\r\n        meta = files[0]\r\n        filename = meta['filename']\r\n        m = self.md5(meta['body'])\r\n        if not self.is_zip_format(content=meta[\"body\"]):\r\n            self.response({\"name\": \"resource\", \"error\": \"Zip File Only Accepted\"})\r\n            self.finish()\r\n            return\r\n        print \"=================================\"\r\n        t = list(self.solo_themes_db.themes.find({\"_id\": m}))\r\n        # if len(t) > 0:\r\n        #     self.response({\"res\": 0, \"msg\": \"确定要重新生成吗？\"})\r\n        #     return\r\n        source_dir = self.storage_dir()\r\n        source_path = \"%s/%s.zip\" % (source_dir, m)\r\n        if not os.path.exists(source_path):\r\n            with open(source_path, 'wb') as up:\r\n                up.write(meta['body'])\r\n\r\n        work_tmp_path, exist = self.storage_tmp_dir(m=m)\r\n        if exist:\r\n            \"\"\"\r\n            TODO: should fixed conflict\r\n            \"\"\"\r\n            pass\r\n        print source_path, work_tmp_path, exist\r\n        res = yield tornado.gen.Task(tasks.build_theme_release_apk.apply_async,\r\n        args=[source_dir, source_path, work_tmp_path, {\"appname\": appName, \"package\": package,\r\n        \"versioncode\": versionCode, \"versionname\": versionName, \"scalefactor\": scaleFactor}])\r\n        res = res.result\r\n        print res\r\n        if res[\"res\"] == 1:\r\n            self.solo_themes_db.themes.save({\"_id\": m, \"apk\":res[\"apk\"], \"source\": res[\"source\"], \"appname\": res[\"appname\"], \"package\": res[\"package\"], \"versioncode\": res[\"versioncode\"], \"versionname\": res[\"versionname\"], \"scalefactor\": res[\"scalefactor\"], 'time': time.time()})\r\n        self.response(res)\r\n\r\n\r\nJust print  print source_path, work_tmp_path, exist  it was blocked at res = yield tornado.gen.Task(....\r\nCan not print res\r\nbut the tasks function completely executed and returned\r\n"},"comment":{"url":"https://api.github.com/repos/mher/tornado-celery/issues/comments/174276767","html_url":"https://github.com/mher/tornado-celery/issues/58#issuecomment-174276767","issue_url":"https://api.github.com/repos/mher/tornado-celery/issues/58","id":174276767,"user":{"login":"zhkzyth","id":618779,"avatar_url":"https://avatars.githubusercontent.com/u/618779?v=3","gravatar_id":"","url":"https://api.github.com/users/zhkzyth","html_url":"https://github.com/zhkzyth","followers_url":"https://api.github.com/users/zhkzyth/followers","following_url":"https://api.github.com/users/zhkzyth/following{/other_user}","gists_url":"https://api.github.com/users/zhkzyth/gists{/gist_id}","starred_url":"https://api.github.com/users/zhkzyth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhkzyth/subscriptions","organizations_url":"https://api.github.com/users/zhkzyth/orgs","repos_url":"https://api.github.com/users/zhkzyth/repos","events_url":"https://api.github.com/users/zhkzyth/events{/privacy}","received_events_url":"https://api.github.com/users/zhkzyth/received_events","type":"User","site_admin":false},"created_at":"2016-01-24T10:14:31Z","updated_at":"2016-01-24T10:14:31Z","body":"@Strawhatfy i just replaced the pika with 0.10.0, but still meet the problem."}}