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"])
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'])
def get_closest_run_time(self): return utc_timestamp_to_datetime(self.job_run_time[0][1]) if self.job_run_time else None