feat: plugins v1
This commit is contained in:
@@ -15,7 +15,12 @@ import {
|
||||
ServerMembershipEntity,
|
||||
ServerInviteEntity,
|
||||
ServerBanEntity,
|
||||
GameMatchMissEntity
|
||||
GameMatchMissEntity,
|
||||
ServerPluginRequirementEntity,
|
||||
ServerPluginEventDefinitionEntity,
|
||||
PluginDataEntity,
|
||||
ServerPluginSettingsEntity,
|
||||
PluginUserMetadataEntity
|
||||
} from '../entities';
|
||||
import { serverMigrations } from '../migrations';
|
||||
import {
|
||||
@@ -49,8 +54,18 @@ const DB_BACKUP = DB_FILE + '.bak';
|
||||
const DATA_DIR = path.dirname(DB_FILE);
|
||||
// SQLite files start with this 16-byte header string.
|
||||
const SQLITE_MAGIC = 'SQLite format 3\0';
|
||||
const SAVE_RETRY_DELAYS_MS = [25, 75, 150, 300, 600];
|
||||
const RETRYABLE_SAVE_ERROR_CODES = new Set(['EPERM', 'EACCES', 'EBUSY']);
|
||||
const SAVE_RETRY_DELAYS_MS = [
|
||||
25,
|
||||
75,
|
||||
150,
|
||||
300,
|
||||
600
|
||||
];
|
||||
const RETRYABLE_SAVE_ERROR_CODES = new Set([
|
||||
'EPERM',
|
||||
'EACCES',
|
||||
'EBUSY'
|
||||
]);
|
||||
|
||||
let applicationDataSource: DataSource | undefined;
|
||||
let saveQueue: Promise<void> = Promise.resolve();
|
||||
@@ -250,7 +265,12 @@ export async function initDatabase(): Promise<void> {
|
||||
ServerMembershipEntity,
|
||||
ServerInviteEntity,
|
||||
ServerBanEntity,
|
||||
GameMatchMissEntity
|
||||
GameMatchMissEntity,
|
||||
ServerPluginRequirementEntity,
|
||||
ServerPluginEventDefinitionEntity,
|
||||
PluginDataEntity,
|
||||
ServerPluginSettingsEntity,
|
||||
PluginUserMetadataEntity
|
||||
],
|
||||
migrations: serverMigrations,
|
||||
synchronize: process.env.DB_SYNCHRONIZE === 'true',
|
||||
|
||||
Reference in New Issue
Block a user