fix: debounce dashboard status requests

This commit is contained in:
Andras Bacsai 2022-08-12 16:14:37 +00:00
parent 9001f34fab
commit 45e2c7bd03
3 changed files with 17 additions and 6 deletions

View File

@ -17,7 +17,7 @@ import { checkContainer, removeContainer } from './docker';
import { day } from './dayjs';
import * as serviceFields from './serviceFields'
export const version = '3.3.1';
export const version = '3.3.2';
export const isDev = process.env.NODE_ENV === 'development';
const algorithm = 'aes-256-ctr';

View File

@ -23,7 +23,7 @@
import { get, post } from '$lib/api';
import Usage from '$lib/components/Usage.svelte';
import { t } from '$lib/translations';
import { errorNotification } from '$lib/common';
import { errorNotification, asyncSleep } from '$lib/common';
import { addToast, appSession } from '$lib/store';
import ApplicationsIcons from '$lib/components/svg/applications/ApplicationIcons.svelte';
@ -37,8 +37,18 @@
export let applications: any;
export let databases: any;
export let services: any;
let numberOfGetStatus = 0;
function getRndInteger(min, max) {
return Math.floor(Math.random() * (max - min + 1) ) + min;
}
async function getStatus(resources: any) {
while (numberOfGetStatus > 1){
await asyncSleep(getRndInteger(100,200));
}
try {
numberOfGetStatus++;
const { id, buildPack, dualCerts } = resources;
let isRunning = false;
if (buildPack) {
@ -58,6 +68,8 @@
}
} catch (error) {
return 'Error';
} finally {
numberOfGetStatus--;
}
}
async function manuallyCleanupStorage() {
@ -82,7 +94,6 @@
>Cleanup Storage</button
>
</div>
<div class="mt-10 pb-12 tracking-tight sm:pb-16">
<div class="mx-auto px-10">
<div class="flex flex-col justify-center xl:flex-row">

View File

@ -1,7 +1,7 @@
{
"name": "coolify",
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
"version": "3.3.1",
"version": "3.3.2",
"license": "Apache-2.0",
"repository": "github:coollabsio/coolify",
"scripts": {