mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
This fixes an issue with external storage in saas environment. See https://github.com/gristlabs/grist-core/pull/546/files#r1259340397 Co-authored-by: Florent FAYOLLE <florent.fayolle@beta.gouv.fr>
This commit is contained in:
parent
b0f76a152f
commit
7694588a42
@ -1132,9 +1132,6 @@ export class FlexServer implements GristServer {
|
||||
await this.loadConfig();
|
||||
this.addComm();
|
||||
|
||||
// Temporary duplication of external storage configuration.
|
||||
// This may break https://github.com/gristlabs/grist-core/pull/546,
|
||||
// but will revive other uses of external storage. TODO: reconcile.
|
||||
await this.create.configure?.();
|
||||
|
||||
if (!isSingleUserMode()) {
|
||||
@ -1147,7 +1144,7 @@ export class FlexServer implements GristServer {
|
||||
this._disableExternalStorage = true;
|
||||
externalStorage.flag('active').set(false);
|
||||
}
|
||||
await this.create.configure?.();
|
||||
await this.create.checkBackend?.();
|
||||
const workers = this._docWorkerMap;
|
||||
const docWorkerId = await this._addSelfAsWorker(workers);
|
||||
|
||||
|
@ -32,6 +32,8 @@ export interface ICreate {
|
||||
sessionSecret(): string;
|
||||
// Check configuration of the app early enough to show on startup.
|
||||
configure?(): Promise<void>;
|
||||
// Optionally perform sanity checks on the configured storage, throwing a fatal error if it is not functional
|
||||
checkBackend?(): Promise<void>;
|
||||
// Return a string containing 1 or more HTML tags to insert into the head element of every
|
||||
// static page.
|
||||
getExtraHeadHtml?(): string;
|
||||
@ -119,6 +121,13 @@ export function makeSimpleCreator(opts: {
|
||||
return secret;
|
||||
},
|
||||
async configure() {
|
||||
for (const s of storage || []) {
|
||||
if (s.check()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
async checkBackend() {
|
||||
for (const s of storage || []) {
|
||||
if (s.check()) {
|
||||
await s.checkBackend?.();
|
||||
|
Loading…
Reference in New Issue
Block a user