Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: debounce dashboard status requests

Andras Bacsai45e2c7bd03f2
diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts
index 9456d59204..ce8b8051da 100644
--- a/apps/api/src/lib/common.ts
+++ b/apps/api/src/lib/common.ts
@@ -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';
diff --git a/apps/ui/src/routes/index.svelte b/apps/ui/src/routes/index.svelte
index 2379ea108d..f615ae9279 100644
--- a/apps/ui/src/routes/index.svelte
+++ b/apps/ui/src/routes/index.svelte
@@ -23,9 +23,9 @@
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';
import DatabaseIcons from '$lib/components/svg/databases/DatabaseIcons.svelte';
import ServiceIcons from '$lib/components/svg/services/ServiceIcons.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,7 +68,9 @@
}
} catch (error) {
return 'Error';
- }
+ } finally {
+ numberOfGetStatus--;
+ }
}
async function manuallyCleanupStorage() {
try {
@@ -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">
diff --git a/package.json b/package.json
index d9c9790d85..9a11294f88 100644
--- a/package.json
+++ b/package.json
@@ -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": {