Add resync commmand

This commit is contained in:
Ethan Lane 2023-11-23 17:28:15 +00:00
parent 091b8e5205
commit 0d6005044c
3 changed files with 45 additions and 2 deletions

View file

@ -7,8 +7,8 @@ import { CardRarity, CardRarityToString } from "../constants/CardRarity";
import Config from "../database/entities/app/Config";
export default class CardSetupFunction {
public static async Execute() {
if (await Config.GetValue('safemode') == "true") return;
public static async Execute(): Promise<boolean> {
if (await Config.GetValue('safemode') == "true") return false;
try {
await this.ClearDatabase();
@ -16,7 +16,10 @@ export default class CardSetupFunction {
await this.ReadCards();
} catch {
await Config.SetValue('safemode', 'true');
return false;
}
return true;
}
private static async ClearDatabase() {