Skip to content

Commit 1e53d3a

Browse files
committed
Add more timestamps in log
1 parent ee2cdd9 commit 1e53d3a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

scripts/aws/entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ TIME_SYNC_INTERVAL_SECONDS="${TIME_SYNC_INTERVAL_SECONDS:-300}"
2727

2828
sync_enclave_time() {
2929
local current_time
30+
local parent_epoch
31+
local enclave_epoch
32+
local drift_seconds
3033
if current_time=$(curl -s -f -x socks5h://127.0.0.1:3305 "${TIME_SYNC_URL}"); then
34+
parent_epoch=$(date -u -d "${current_time}" +%s 2>/dev/null || true)
35+
enclave_epoch=$(date -u +%s)
36+
if [[ -n "${parent_epoch}" ]]; then
37+
drift_seconds=$((enclave_epoch - parent_epoch))
38+
echo "Time sync: drift seconds (enclave - parent) = ${drift_seconds}"
39+
fi
3140
if ! date -u -s "${current_time}"; then
3241
echo "Time sync: failed to set enclave time from '${current_time}'"
3342
return 1

0 commit comments

Comments
 (0)