mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
fixed Issue #3
This commit is contained in:
@@ -159,7 +159,7 @@ class SpiderApi(BaseApi):
|
||||
db_manager.save('tasks', {
|
||||
'_id': job.id,
|
||||
'spider_id': ObjectId(id),
|
||||
'create_ts': datetime.now(),
|
||||
'create_ts': datetime.utcnow(),
|
||||
'status': TaskStatus.PENDING
|
||||
})
|
||||
|
||||
@@ -252,7 +252,7 @@ class SpiderApi(BaseApi):
|
||||
db_manager.save('deploys', {
|
||||
'spider_id': ObjectId(id),
|
||||
'node_id': node_id,
|
||||
'finish_ts': datetime.now()
|
||||
'finish_ts': datetime.utcnow()
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -41,7 +41,7 @@ def execute_spider(self, id: str):
|
||||
|
||||
# create a new task
|
||||
db_manager.update_one('tasks', id=task_id, values={
|
||||
'start_ts': datetime.now(),
|
||||
'start_ts': datetime.utcnow(),
|
||||
'node_id': hostname,
|
||||
'hostname': hostname,
|
||||
'log_file_path': log_file_path,
|
||||
@@ -72,11 +72,11 @@ def execute_spider(self, id: str):
|
||||
|
||||
# save task when the task is finished
|
||||
db_manager.update_one('tasks', id=task_id, values={
|
||||
'start_ts': datetime.now(),
|
||||
'start_ts': datetime.utcnow(),
|
||||
'node_id': hostname,
|
||||
'hostname': hostname,
|
||||
'log_file_path': log_file_path,
|
||||
'finish_ts': datetime.now(),
|
||||
'finish_ts': datetime.utcnow(),
|
||||
'status': status
|
||||
})
|
||||
task = db_manager.get('tasks', id=id)
|
||||
|
||||
Reference in New Issue
Block a user