fix(backend): add async lock to prevent Already borrowed issue

This commit is contained in:
h
2026-01-25 16:52:15 +01:00
parent a992e3f0c2
commit f97933bc9b
2 changed files with 10 additions and 4 deletions

View File

@@ -2,13 +2,15 @@
import './layout.css';
import favicon from '$lib/assets/favicon.svg';
import { PUBLIC_CONVEX_URL } from '$env/static/public';
import { env } from '$env/dynamic/public';
import { setupConvex } from 'convex-svelte';
import { hasWebSocketSupport, setupPollingConvex } from '$lib/convex-polling.svelte';
import { setContext } from 'svelte';
let { children } = $props();
const usePolling = !hasWebSocketSupport();
const fallbackEnabled = env.PUBLIC_FALLBACK === '1';
const usePolling = fallbackEnabled && !hasWebSocketSupport();
setContext('convex-use-polling', usePolling);
if (usePolling) {