mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) move DocUsageBanner to ext
Summary: grist-ee build was failing since it didn't have a DocUsageBanner implementation available. Made the implementation added to monorepo available, since it will be useful to improve the activation banner. Test Plan: manaul Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: georgegevoian Differential Revision: https://phab.getgrist.com/D3452
This commit is contained in:
parent
b9a4b2b58f
commit
dcaa2b4f29
@ -13,6 +13,7 @@
|
|||||||
// changed during construction of a query.
|
// changed during construction of a query.
|
||||||
|
|
||||||
import * as sqlite3 from '@gristlabs/sqlite3';
|
import * as sqlite3 from '@gristlabs/sqlite3';
|
||||||
|
import * as log from 'app/server/lib/log';
|
||||||
import {Mutex, MutexInterface} from 'async-mutex';
|
import {Mutex, MutexInterface} from 'async-mutex';
|
||||||
import isEqual = require('lodash/isEqual');
|
import isEqual = require('lodash/isEqual');
|
||||||
import {EntityManager, QueryRunner} from 'typeorm';
|
import {EntityManager, QueryRunner} from 'typeorm';
|
||||||
@ -102,6 +103,7 @@ export function applyPatch() {
|
|||||||
await queryRunner.commitTransaction();
|
await queryRunner.commitTransaction();
|
||||||
return result;
|
return result;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
log.debug(`SQLite transaction error [${arg1} ${arg2}] - ${err}`);
|
||||||
try {
|
try {
|
||||||
// we throw original error even if rollback thrown an error
|
// we throw original error even if rollback thrown an error
|
||||||
await queryRunner.rollbackTransaction();
|
await queryRunner.rollbackTransaction();
|
||||||
|
@ -55,8 +55,12 @@ export async function getOrCreateConnection(): Promise<Connection> {
|
|||||||
// If multiple servers are started within the same process, we
|
// If multiple servers are started within the same process, we
|
||||||
// share the database connection. This saves locking trouble
|
// share the database connection. This saves locking trouble
|
||||||
// with Sqlite.
|
// with Sqlite.
|
||||||
return getConnection();
|
const connection = getConnection();
|
||||||
|
return connection;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (!String(e).match(/ConnectionNotFoundError/)) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
const connection = await createConnection();
|
const connection = await createConnection();
|
||||||
// When using Sqlite, set a busy timeout of 3s to tolerate a little
|
// When using Sqlite, set a busy timeout of 3s to tolerate a little
|
||||||
// interference from connections made by tests. Logging doesn't show
|
// interference from connections made by tests. Logging doesn't show
|
||||||
|
Loading…
Reference in New Issue
Block a user