handoff: timezone-aware timestamp in queue entries
datetime.utcnow() is deprecated and printed a DeprecationWarning on every submit; the queuedAt field is unchanged in format.
This commit is contained in:
1 parent
bbe587377a
commit
499a109fd8
1 file changed
+1
-1
+1
-1
@@ -65,7 +65,7 @@ cmd_submit() {
|
||||
python3 - "$QUEUE/$id.json" "$id" "$dir" "$role" "$bpath" <<'PY'
|
||||
import json, sys, datetime
|
||||
path, rid, d, role, brief = sys.argv[1:6]
|
||||
json.dump({"id": rid, "dir": d, "role": role, "brief": brief, "queuedAt": datetime.datetime.utcnow().isoformat()+"Z"}, open(path, "w"), indent=1)
|
||||
json.dump({"id": rid, "dir": d, "role": role, "brief": brief, "queuedAt": datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None).isoformat()+"Z"}, open(path, "w"), indent=1)
|
||||
PY
|
||||
printf 'queued %s\n dir: %s\n role: %s\n log: %s/%s/run.log\n' "$id" "$dir" "$role" "$STATE" "$id"
|
||||
echo " start the daemon if it is not running: handoff daemon &"
|
||||
|
||||
Reference in new issue
Block a user