We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee2cdd9 commit 1e53d3aCopy full SHA for 1e53d3a
1 file changed
scripts/aws/entrypoint.sh
@@ -27,7 +27,16 @@ TIME_SYNC_INTERVAL_SECONDS="${TIME_SYNC_INTERVAL_SECONDS:-300}"
27
28
sync_enclave_time() {
29
local current_time
30
+ local parent_epoch
31
+ local enclave_epoch
32
+ local drift_seconds
33
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
40
if ! date -u -s "${current_time}"; then
41
echo "Time sync: failed to set enclave time from '${current_time}'"
42
return 1
0 commit comments