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();
|
await this.loadConfig();
|
||||||
this.addComm();
|
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?.();
|
await this.create.configure?.();
|
||||||
|
|
||||||
if (!isSingleUserMode()) {
|
if (!isSingleUserMode()) {
|
||||||
@ -1147,7 +1144,7 @@ export class FlexServer implements GristServer {
|
|||||||
this._disableExternalStorage = true;
|
this._disableExternalStorage = true;
|
||||||
externalStorage.flag('active').set(false);
|
externalStorage.flag('active').set(false);
|
||||||
}
|
}
|
||||||
await this.create.configure?.();
|
await this.create.checkBackend?.();
|
||||||
const workers = this._docWorkerMap;
|
const workers = this._docWorkerMap;
|
||||||
const docWorkerId = await this._addSelfAsWorker(workers);
|
const docWorkerId = await this._addSelfAsWorker(workers);
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@ export interface ICreate {
|
|||||||
sessionSecret(): string;
|
sessionSecret(): string;
|
||||||
// Check configuration of the app early enough to show on startup.
|
// Check configuration of the app early enough to show on startup.
|
||||||
configure?(): Promise<void>;
|
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
|
// Return a string containing 1 or more HTML tags to insert into the head element of every
|
||||||
// static page.
|
// static page.
|
||||||
getExtraHeadHtml?(): string;
|
getExtraHeadHtml?(): string;
|
||||||
@ -119,6 +121,13 @@ export function makeSimpleCreator(opts: {
|
|||||||
return secret;
|
return secret;
|
||||||
},
|
},
|
||||||
async configure() {
|
async configure() {
|
||||||
|
for (const s of storage || []) {
|
||||||
|
if (s.check()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async checkBackend() {
|
||||||
for (const s of storage || []) {
|
for (const s of storage || []) {
|
||||||
if (s.check()) {
|
if (s.check()) {
|
||||||
await s.checkBackend?.();
|
await s.checkBackend?.();
|
||||||
|
Loading…
Reference in New Issue
Block a user