Signed-off-by: bnechyporenko <bnechyporenko@bol.com>
This commit is contained in:
bnechyporenko
2024-08-25 20:13:09 +02:00
parent 3e4d0a2f04
commit 6bd9e0361b
2 changed files with 9 additions and 12 deletions
@@ -532,10 +532,8 @@ export class DatabaseTaskStore implements TaskStore {
}
async cleanWorkspace({ taskId }: { taskId: string }): Promise<void> {
await this.db.transaction(async tx => {
await tx('tasks').where({ id: taskId }).update({
workspace: null,
});
await this.db('tasks').where({ id: taskId }).update({
workspace: null,
});
}
@@ -544,13 +542,12 @@ export class DatabaseTaskStore implements TaskStore {
taskId: string;
}): Promise<void> {
if (options.path) {
await this.db.transaction(async tx => {
await tx<RawDbTaskRow>('tasks')
.where({ id: options.taskId })
.update({
workspace: (await serializeWorkspace(options)).contents,
});
});
const workspace = (await serializeWorkspace(options)).contents;
await this.db<RawDbTaskRow>('tasks')
.where({ id: options.taskId })
.update({
workspace,
});
}
}
@@ -29,7 +29,7 @@ export class DatabaseWorkspaceProvider implements WorkspaceProvider {
path: string;
taskId: string;
}): Promise<void> {
this.storage.serializeWorkspace?.(options);
await this.storage.serializeWorkspace?.(options);
}
public async rehydrateWorkspace(options: {