mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fix snapshot migrations
Summary: Migrations were failing in snapshots due to the sandbox no longer being started in snapshots. We now start up an instance of the sandbox whenever there are migrations to run, and immediately shut it down on completion. Test Plan: Server test. Reviewers: paulfitz Reviewed By: paulfitz Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3898
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
import {ISandbox} from 'app/server/lib/ISandbox';
|
||||
|
||||
export class UnavailableSandboxMethodError extends Error {
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
||||
export class NullSandbox implements ISandbox {
|
||||
public async shutdown(): Promise<unknown> {
|
||||
return undefined;
|
||||
throw new UnavailableSandboxMethodError('shutdown is not available');
|
||||
}
|
||||
|
||||
public async pyCall(_funcName: string, ..._varArgs: unknown[]) {
|
||||
return undefined;
|
||||
throw new UnavailableSandboxMethodError('pyCall is not available');
|
||||
}
|
||||
|
||||
public async reportMemoryUsage() {
|
||||
return undefined;
|
||||
throw new UnavailableSandboxMethodError('reportMemoryUsage is not available');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user