Can stop sync thread from UI

This commit is contained in:
2025-11-19 18:41:26 +01:00
parent 564e606ac7
commit 0d8905d842
4 changed files with 152 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ import { APIClient } from "./ApiClient";
export class MatrixSyncApi {
/**
* Force sync thread startup
* Start sync thread
*/
static async Start(): Promise<void> {
await APIClient.exec({
@@ -10,4 +10,25 @@ export class MatrixSyncApi {
uri: "/matrix_sync/start",
});
}
/**
* Stop sync thread
*/
static async Stop(): Promise<void> {
await APIClient.exec({
method: "POST",
uri: "/matrix_sync/stop",
});
}
/**
* Get sync thread status
*/
static async Status(): Promise<boolean> {
const res = await APIClient.exec({
method: "GET",
uri: "/matrix_sync/status",
});
return res.data.started;
}
}