Skip to content

Commit d0d6903

Browse files
committed
Remove the test and set the cronjob to run once a day
1 parent cb04ca4 commit d0d6903

2 files changed

Lines changed: 1 addition & 25 deletions

File tree

scripts/aws/entrypoint.sh

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,6 @@ echo "Starting vsock proxy..."
2525
TIME_SYNC_URL="http://127.0.0.1:27015/getCurrentTime"
2626
TIME_SYNC_PROXY="socks5h://127.0.0.1:3305"
2727
TIME_SYNC_TRIGGER_PORT="${TIME_SYNC_TRIGGER_PORT:-27100}"
28-
TIME_SYNC_OFFSET_SECONDS="${TIME_SYNC_OFFSET_SECONDS:-30}"
29-
30-
sync_enclave_time_with_offset_once() {
31-
local current_time
32-
local parent_epoch
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-
if [[ -n "${parent_epoch}" ]]; then
36-
parent_epoch=$((parent_epoch + TIME_SYNC_OFFSET_SECONDS))
37-
if ! date -u -s "@${parent_epoch}"; then
38-
echo "Time sync: failed to set enclave time from '${current_time}' with offset ${TIME_SYNC_OFFSET_SECONDS}s"
39-
return 1
40-
fi
41-
echo "Time sync: updated enclave time to ${current_time} + ${TIME_SYNC_OFFSET_SECONDS}s"
42-
fi
43-
else
44-
echo "Time sync: failed to fetch time from parent instance"
45-
return 1
46-
fi
47-
}
48-
49-
sync_enclave_time_with_offset_once || true
50-
51-
5228

5329
start_time_sync_server() {
5430
python3 -u - <<'PY' &

scripts/aws/uid2-operator-ami/ansible/playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
dest: /etc/cron.d/uid2-time-sync
267267
mode: "0644"
268268
content: |
269-
*/5 * * * * root /usr/local/bin/uid2-time-sync
269+
0 0 * * * root /usr/local/bin/uid2-time-sync
270270
271271
- name: Clean up tmp files
272272
file:

0 commit comments

Comments
 (0)