Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release SQS for docker-compose.yaml users (includes budi CLI users) #13999

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hosting/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ services:

couchdb-service:
restart: unless-stopped
image: budibase/couchdb
image: budibase/couchdb:v3.3.3
environment:
- COUCHDB_PASSWORD=${COUCH_DB_PASSWORD}
- COUCHDB_USER=${COUCH_DB_USER}
Expand Down
35 changes: 15 additions & 20 deletions packages/frontend-core/src/components/Updating.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,31 @@
export let isMigrationDone
export let onMigrationDone
export let timeoutSeconds = 60 // 1 minute
export let minTimeSeconds = 3

const loadTime = Date.now()
const intervalMs = 1000
let timedOut = false
let secondsWaited = 0

async function checkMigrationsFinished() {
setTimeout(async () => {
const isMigrated = await isMigrationDone()

const timeoutMs = timeoutSeconds * 1000
if (!isMigrated || secondsWaited <= minTimeSeconds) {
if (loadTime + timeoutMs > Date.now()) {
secondsWaited += 1
return checkMigrationsFinished()
}
let totalWaitMs = 0
// eslint-disable-next-line no-constant-condition
while (true) {
const waitForMs = 5000 + Math.random() * 5000
await new Promise(resolve => setTimeout(resolve, waitForMs))
totalWaitMs += waitForMs

return migrationTimeout()
const isMigrated = await isMigrationDone()
if (isMigrated) {
onMigrationDone()
return
}

onMigrationDone()
}, intervalMs)
if (totalWaitMs > timeoutSeconds * 1000) {
timedOut = true
return
}
}
}

checkMigrationsFinished()

function migrationTimeout() {
timedOut = true
}
</script>

<div class="loading" class:timeout={timedOut}>
Expand Down
Loading