File tree Expand file tree Collapse file tree
routes/(console)/project-[region]-[project]/functions/function-[function]/deployment-[deployment] Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,11 +3,7 @@ import type { Models } from '@appwrite.io/console';
33/**
44 * Checks if a build has exceeded the maximum build timeout duration
55 */
6- export function isBuildTimedOut (
7- createdAt : string ,
8- status : string ,
9- timeoutSeconds : number
10- ) : boolean {
6+ function isBuildTimedOut ( createdAt : string , status : string , timeoutSeconds : number ) : boolean {
117 if ( ! [ 'waiting' , 'processing' , 'building' ] . includes ( status ) ) {
128 return false ;
139 }
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { Button } from ' $lib/elements/forms' ;
33 import { Container } from ' $lib/layout' ;
4- import { sdk } from ' $lib/stores/sdk' ;
4+ import { realtime } from ' $lib/stores/sdk' ;
55 import { onMount } from ' svelte' ;
66 import { type Models } from ' @appwrite.io/console' ;
77 import { page } from ' $app/state' ;
5353 let showRedeploy = $state (false );
5454
5555 onMount (() => {
56- const unsubscribe = sdk .forConsole .client .subscribe <Models .Deployment >(
57- ' console' ,
58- (message ) => {
59- if (
60- message .events .includes (
61- ` functions.${page .params .function }.deployments.${page .params .deployment }.update `
62- )
63- ) {
64- if ([' ready' , ' failed' ].includes (message .payload .status )) {
65- invalidate (Dependencies .DEPLOYMENT );
66- }
56+ return realtime .forConsole (page .params .region , ' console' , (message ) => {
57+ if (
58+ message .events .includes (
59+ ` functions.${page .params .function }.deployments.${page .params .deployment }.update `
60+ )
61+ ) {
62+ const payload = message .payload as Models .Deployment ;
63+ if ([' ready' , ' failed' ].includes (payload .status )) {
64+ invalidate (Dependencies .DEPLOYMENT );
6765 }
6866 }
69- );
70- return unsubscribe ;
67+ });
7168 });
7269
7370 export function badgeTypeDeployment(status : string ) {
You can’t perform that action at this time.
0 commit comments