Skip to content

Commit

Permalink
#update
Browse files Browse the repository at this point in the history
  • Loading branch information
yutiansut committed Mar 27, 2019
1 parent ea4f632 commit 15ed95b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions quantaxis_run/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
import datetime

platforms.C_FORCE_ROOT = True # 加上这一行
client_qa = pymongo.MongoClient(connect=False).quantaxis.joblog
client_joblist = pymongo.MongoClient(connect=False).quantaxis.joblist
client_qa.create_index([('filename', pymongo.ASCENDING),
('job_id', pymongo.ASCENDING), ('time', pymongo.ASCENDING)])


schedule_client = pymongo.MongoClient(connect=False).quantaxis.schedule



"""schedule
Expand Down Expand Up @@ -68,7 +66,10 @@ class celeryconfig():

@app.task(bind=True)
def quantaxis_run(self, shell_cmd, program='python'):

client_joblist = pymongo.MongoClient(connect=False).quantaxis.joblist
client_qa = pymongo.MongoClient(connect=False).quantaxis.joblog
client_qa.create_index([('filename', pymongo.ASCENDING),
('job_id', pymongo.ASCENDING), ('time', pymongo.ASCENDING)])
filename = shell_cmd
shell_cmd = '{} "{}" --taskid {}'.format(program, shell_cmd, self.request.id)

Expand Down Expand Up @@ -114,7 +115,10 @@ def quantaxis_run(self, shell_cmd, program='python'):

@app.task(bind=True)
def run_shell(self, shell_cmd):

client_joblist = pymongo.MongoClient(connect=False).quantaxis.joblist
client_qa = pymongo.MongoClient(connect=False).quantaxis.joblog
client_qa.create_index([('filename', pymongo.ASCENDING),
('job_id', pymongo.ASCENDING), ('time', pymongo.ASCENDING)])
filename = shell_cmd
shell_cmd = '{} --taskid {}'.format(shell_cmd, self.request.id)

Expand Down

0 comments on commit 15ed95b

Please sign in to comment.