Skip to content

Commit 49480ce

Browse files
authored
Merge pull request #863 from github/lildude/reset-connect-job-run-time
Prevent GitHub Connect jobs running until config has been reset
2 parents d29bc68 + 00cf7eb commit 49480ce

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

bin/ghe-restore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,14 @@ echo "Restarting memcached ..." 1>&3
446446
echo "sudo restart -q memcached 2>/dev/null || true" |
447447
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh
448448

449+
# Prevent GitHub Connect jobs running before we've had a chance to reset
450+
# the configuration by setting the last run date to now.
451+
if ! $RESTORE_SETTINGS; then
452+
echo "Setting last run date for GitHub Connect jobs ..." 1>&3
453+
echo "now=$(date +%s.0000000); ghe-redis-cli mset timer:UpdateConnectInstallationInfo \$now timer:UploadEnterpriseServerUserAccountsJob \$now timer:UploadConnectMetricsJob \$now timer:GitHubConnectPushNewContributionsJob \$now" |
454+
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh 1>&3
455+
fi
456+
449457
# When restoring to a host that has already been configured, kick off a
450458
# config run to perform data migrations.
451459
if $CLUSTER; then

test/bin/ghe-redis-cli

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ while true; do
1818
echo "fake redis data" > "$GHE_REMOTE_DATA_USER_DIR/redis/dump.rdb"
1919
break
2020
;;
21+
mset)
22+
# Fake accepting of mset command
23+
shift 9
24+
break
25+
;;
2126
--remote)
2227
# Fake accepting hostname argument
2328
shift 3

0 commit comments

Comments
 (0)