From 46d11af7ff70c3e7dd1eb93fa5753aa13ca5af92 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Sun, 8 Dec 2024 11:36:13 +0700 Subject: [PATCH 1/2] Fix docker push script and mongo dump script (#7293) Signed-off-by: Andrey Sobolev --- common/scripts/docker_tag.sh | 18 +++++++++--------- common/scripts/docker_tag_push.sh | 2 +- common/scripts/mongo_dump.sh | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/scripts/docker_tag.sh b/common/scripts/docker_tag.sh index ffbb926f54..36446689f7 100755 --- a/common/scripts/docker_tag.sh +++ b/common/scripts/docker_tag.sh @@ -11,15 +11,15 @@ then version="${a[0]}.${a[1]}.${c}-staging" echo "Tagging staging $1 with version ${version}" docker tag "$1:$rev_version" "$1:$version" - for n in {1..5}; do + for n in {1..25}; do docker push "$1:$version" && break - if (( $n < 5 )) + if (( $n < 25 )) then echo 'Docker failed to push, wait 5 second' sleep 5 else - echo '5 push attempts failed, exiting with failure' + echo '25 push attempts failed, exiting with failure' exit 1 fi done @@ -27,27 +27,27 @@ else echo "Tagging release $1 with version ${version}" docker tag "$1:$rev_version" "$1:$version" docker tag "$1:$rev_version" "$1:latest" - for n in {1..5}; do + for n in {1..25}; do docker push "$1:$version" && break - if (( $n < 5 )) + if (( $n < 25 )) then echo 'Docker failed to push, wait 5 second' sleep 5 else - echo '5 push attempts failed, exiting with failure' + echo '25 push attempts failed, exiting with failure' exit 1 fi done - for n in {1..5}; do + for n in {1..25}; do docker push "$1:latest" && break - if (( $n < 5 )) + if (( $n < 25 )) then echo 'Docker failed to push, wait 5 second' sleep 5 else - echo '5 push attempts failed, exiting with failure' + echo '25 push attempts failed, exiting with failure' exit 1 fi done diff --git a/common/scripts/docker_tag_push.sh b/common/scripts/docker_tag_push.sh index 5b0737ebba..48fb28f854 100755 --- a/common/scripts/docker_tag_push.sh +++ b/common/scripts/docker_tag_push.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash echo "Tagging release $1 with version $2" docker tag "$1" "$1:$2" -for n in {1..5}; do +for n in {1..25}; do docker push "$1:$2" && break echo 'Docker failed to push, wait 5 seconds' sleep 5 diff --git a/common/scripts/mongo_dump.sh b/common/scripts/mongo_dump.sh index 05b3e58d2a..2846c89f18 100755 --- a/common/scripts/mongo_dump.sh +++ b/common/scripts/mongo_dump.sh @@ -8,7 +8,7 @@ trap "exit" INT mkdir -p ${dump} mkdir -p ${dump}/workspaces -get_dbs="db.getSiblingDB('account').getCollection('workspace').find({lastVisit: {\$gt: Date.now() - ($DAYS * 24 * 60 * 60 * 1000)}}).forEach(it=>console.log(it.workspace, it.lastVisit))" +get_dbs="db.getSiblingDB('account').getCollection('workspace').find({ disabled: {\$ne:true}, mode: 'active', lastVisit: {\$gt: Date.now() - ($DAYS * 24 * 60 * 60 * 1000)}}).forEach(it=>console.log(it.workspace, it.lastVisit))" mongosh --version mongosh ${MONGO_URL} --eval "$get_dbs" > ${dump}/databases.list From 52b21efee759593c356c60052c02e53c20f4417f Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Sun, 8 Dec 2024 13:10:23 +0700 Subject: [PATCH 2/2] QFIX OnConnect (#7297) Signed-off-by: Andrey Sobolev --- plugins/client-resources/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/client-resources/src/index.ts b/plugins/client-resources/src/index.ts index 4a281080ee..d98ad98f12 100644 --- a/plugins/client-resources/src/index.ts +++ b/plugins/client-resources/src/index.ts @@ -121,11 +121,12 @@ export default async () => { newOpt.onConnect = async (event, data) => { // Any event is fine, it means server is alive. clearTimeout(connectTO) + await opt?.onConnect?.(event, data) resolve() } }) } - const clientConnection = connect(url, upgradeHandler, tokenPayload.workspace, tokenPayload.email, opt) + const clientConnection = connect(url, upgradeHandler, tokenPayload.workspace, tokenPayload.email, newOpt) if (connectPromise !== undefined) { await connectPromise }