Skip to content

Commit 2d6e948

Browse files
Merge pull request #767 from appwrite/fix-race-condition-functions
fix: functions race condition for state
2 parents 0cfca8f + 0a05cd4 commit 2d6e948

File tree

2 files changed

+8
-5
lines changed
  • src/routes/console/project-[project]/functions

2 files changed

+8
-5
lines changed

src/routes/console/project-[project]/functions/+layout.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ import type { LayoutLoad } from './$types';
88
export const load: LayoutLoad = async ({ depends }) => {
99
depends(Dependencies.FUNCTION_INSTALLATIONS);
1010

11+
const [runtimesList, installations] = await Promise.all([
12+
sdk.forProject.functions.listRuntimes(),
13+
sdk.forProject.vcs.listInstallations([Query.limit(100)])
14+
]);
15+
1116
return {
1217
header: Header,
1318
breadcrumbs: Breadcrumbs,
14-
runtimesList: sdk.forProject.functions.listRuntimes(),
15-
installations: sdk.forProject.vcs.listInstallations([Query.limit(100)])
19+
runtimesList,
20+
installations
1621
};
1722
};

src/routes/console/project-[project]/functions/function-[function]/settings/+page.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ export const load: PageLoad = async ({ params, depends }) => {
3131

3232
return {
3333
variables,
34-
globalVariables,
35-
runtimesList: sdk.forProject.functions.listRuntimes(),
36-
installations: sdk.forProject.vcs.listInstallations()
34+
globalVariables
3735
};
3836
};

0 commit comments

Comments
 (0)