Skip to content

Commit

Permalink
Switch to time.time()
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCreosote committed Dec 20, 2021
1 parent f32c11f commit e7b5115
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/execution_engine2/db/MongoUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import time
import traceback
from contextlib import contextmanager
from datetime import datetime, timezone
from typing import Dict, List
from bson.objectid import ObjectId
from mongoengine import connect, connection
Expand Down Expand Up @@ -285,7 +284,7 @@ def update_jobs_to_queued(

bulk_update_scheduler_jobs = []
bulk_update_created_to_queued = []
queue_time_now = datetime.now(tz=timezone.utc).timestamp()
queue_time_now = time.time()
for job_id_pair in job_id_pairs:
if job_id_pair.job_id is None:
raise ValueError(
Expand Down
5 changes: 2 additions & 3 deletions test/tests_for_db/ee2_MongoUtil_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
import logging
import os
import time
import unittest
from datetime import datetime, timezone

from bson.objectid import ObjectId

Expand Down Expand Up @@ -87,8 +87,7 @@ def test_update_jobs_enmasse(self):
scheduler_ids = ["humpty", "dumpty", "alice"]
jobs_to_update = list(map(JobIdPair, job_ids, scheduler_ids))

now_ms = datetime.now(tz=timezone.utc).timestamp()

now_ms = time.time()
self.getMongoUtil().update_jobs_to_queued(jobs_to_update)
job.reload()
job2.reload()
Expand Down

0 comments on commit e7b5115

Please sign in to comment.