Use seconds instead of ms

This commit is contained in:
Adria Navarro 2024-01-08 12:51:29 +01:00
parent f7b74a3573
commit 13325b63a2
1 changed files with 2 additions and 1 deletions

View File

@ -2,7 +2,7 @@
import { API } from "api" import { API } from "api"
export let onMigrationDone export let onMigrationDone
export let timeoutMs = 180000 // 3 minutes export let timeoutSeconds = 3 * 60 // 3 minutes
const loadTime = Date.now() const loadTime = Date.now()
let timedOut = false let timedOut = false
@ -11,6 +11,7 @@
setTimeout(async () => { setTimeout(async () => {
const response = await API.getMigrationStatus() const response = await API.getMigrationStatus()
const timeoutMs = timeoutSeconds * 1000
if (!response.migrated) { if (!response.migrated) {
if (loadTime + timeoutMs > Date.now()) { if (loadTime + timeoutMs > Date.now()) {
return checkMigrationsFinished() return checkMigrationsFinished()