@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user