Skip to content

Commit 66beec6

Browse files
authored
Merge pull request #428 from Dstack-TEE/sdk-fix-is-reachable-api
fix(sdk/js): isReachable not works for dstack v0.5.x
2 parents 6ce16c2 + 516940f commit 66beec6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

sdk/js/src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export class DstackClient<T extends TcbInfo = TcbInfoV05x> {
253253
async isReachable(): Promise<boolean> {
254254
try {
255255
// Use info endpoint to test connectivity with 500ms timeout
256-
await send_rpc_request(this.endpoint, '/prpc/Tappd.Info', '{}', 500)
256+
await send_rpc_request(this.endpoint, '/Info', '{}', 500)
257257
return true
258258
} catch (error) {
259259
return false
@@ -438,4 +438,14 @@ export class TappdClient extends DstackClient<TcbInfoV03x> {
438438
})
439439
return Object.freeze(result)
440440
}
441+
442+
async isReachable(): Promise<boolean> {
443+
try {
444+
// Use info endpoint to test connectivity with 500ms timeout
445+
await send_rpc_request(this.endpoint, '/prpc/Tappd.Info', '{}', 500)
446+
return true
447+
} catch (error) {
448+
return false
449+
}
450+
}
441451
}

0 commit comments

Comments
 (0)