Skip to content

Commit

Permalink
Refactor utcnow usage in dstool (#4021)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvru authored Apr 23, 2024
1 parent 86ec152 commit 74a626e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ydb/apps/dstool/lib/dstool_cmd_cluster_workload_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import random
import subprocess
import ydb.apps.dstool.lib.grouptool as grouptool
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from collections import defaultdict
import sys

Expand Down Expand Up @@ -215,7 +215,7 @@ def do_kill_blob_depot():

################################################################################################################

now = datetime.utcnow()
now = datetime.now(timezone.utc)
while recent_restarts and recent_restarts[0] + timedelta(minutes=1) < now:
recent_restarts.pop(0)

Expand Down Expand Up @@ -283,7 +283,7 @@ def pick(v):
################################################################################################################

action_name, action = random.choice(possible_actions)
print('%s %s' % (action_name, datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S')))
print('%s %s' % (action_name, datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%S')))

try:
action[0](*action[1:])
Expand Down

0 comments on commit 74a626e

Please sign in to comment.