mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: leaking wss.
This commit is contained in:
1 parent
b0f729bff6
commit
52c583345b
2 files changed
+18
-8
No files matched your search
+9
-4
@@ -7,7 +7,7 @@
|
||||
import Aside from '../aside.svelte';
|
||||
import Logs from '../../(components)/logs.svelte';
|
||||
import { Copy, SvgIcon } from '$lib/components';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { type AppwriteRealtimeSubscription, sdk } from '$lib/stores/sdk';
|
||||
import { goto } from '$app/navigation';
|
||||
import { onMount } from 'svelte';
|
||||
import { getFrameworkIcon } from '$lib/stores/sites';
|
||||
@@ -17,8 +17,8 @@
|
||||
let deployment = $state(data.deployment);
|
||||
|
||||
onMount(() => {
|
||||
return sdk
|
||||
.forConsoleIn(page.params.region)
|
||||
let subscription: AppwriteRealtimeSubscription;
|
||||
sdk.forConsoleIn(page.params.region)
|
||||
.realtime.subscribe('console', async (response) => {
|
||||
if (
|
||||
response.events.includes(
|
||||
@@ -37,7 +37,12 @@
|
||||
await goto(`${resolvedUrl}?site=${data.site.$id}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.then((realtime) => (subscription = realtime));
|
||||
|
||||
return () => {
|
||||
subscription?.close();
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
+9
-4
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { Container } from '$lib/layout';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { type AppwriteRealtimeSubscription, sdk } from '$lib/stores/sdk';
|
||||
import { onMount } from 'svelte';
|
||||
import SiteCard from '../../../(components)/siteCard.svelte';
|
||||
import Logs, { badgeTypeDeployment } from '../../../(components)/logs.svelte';
|
||||
@@ -31,8 +31,8 @@
|
||||
let showCancel = $state(false);
|
||||
|
||||
onMount(() => {
|
||||
return sdk
|
||||
.forConsoleIn(page.params.region)
|
||||
let subscription: AppwriteRealtimeSubscription;
|
||||
sdk.forConsoleIn(page.params.region)
|
||||
.realtime.subscribe('console', async (response) => {
|
||||
if (
|
||||
response.events.includes(
|
||||
@@ -41,7 +41,12 @@
|
||||
) {
|
||||
await invalidate(Dependencies.DEPLOYMENT);
|
||||
}
|
||||
});
|
||||
})
|
||||
.then((realtime) => (subscription = realtime));
|
||||
|
||||
return () => {
|
||||
subscription?.close();
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in new issue
Block a user