Can stop sync thread from UI
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user