예제 #1
0
파일: mongodb.py 프로젝트: ynjgit/Elric
 def get_closest_run_time(self):
     cursor = (
         self.db.elric_jobs.find({}, {"next_timestamp": True, "_id": False})
         .sort([("next_timestamp", pymongo.ASCENDING)])  # projection
         .limit(1)
     )
     if cursor.count() > 0:
         return utc_timestamp_to_datetime(cursor[0]["next_timestamp"])
예제 #2
0
 def get_closest_run_time(self):
     cursor = self.db.elric_jobs.find({}, {
         'next_timestamp': True,
         '_id': False
     }).sort([  #projection
         ("next_timestamp", pymongo.ASCENDING),
     ]).limit(1)
     if cursor.count() > 0:
         return utc_timestamp_to_datetime(cursor[0]['next_timestamp'])
예제 #3
0
파일: memory.py 프로젝트: w1491955388/Elric
 def get_closest_run_time(self):
     return utc_timestamp_to_datetime(self.job_run_time[0][1]) if self.job_run_time else None