Skip to content

Commit

Permalink
Add randomized sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Lincoln Bryant committed Apr 18, 2024
1 parent cd20fa2 commit 6b5dd83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion cron/sync_users.cron

This file was deleted.

4 changes: 4 additions & 0 deletions image-config/60-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ popd

echo 'export PATH="$PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin"' >> $CONNECT_DIR/config
echo "export API_TOKEN_FILE=$CONNECT_DIR/token" >> $CONNECT_DIR/config

###############################################################################
# Set up periodic syncs with randomized jitter to avoid hammering the API too hard
echo '*/10 * * * * root ( sleep $((RANDOM%300)) && cd /usr/local/ciconnect && source /usr/local/ciconnect/config && ./sync_users.sh -u root.atlas-af -g root.atlas-af -e https://api.ci-connect.net:18080 ) >> /var/log/provisioner.log 2>&1' > /etc/cron.d/sync_users.cron

0 comments on commit 6b5dd83

Please sign in to comment.