fix: newsletter receiver backup and env Defaults
This commit is contained in:
parent
c3e8b6b53b
commit
872e6ef9fe
5 changed files with 30 additions and 12 deletions
|
@ -24,8 +24,8 @@ export const MAIL_SECURE = process.env.MAIL_SECURE ?? "false";
|
|||
export const CLUB_NAME = process.env.CLUB_NAME ?? "FF Admin";
|
||||
export const CLUB_WEBSITE = process.env.CLUB_WEBSITE ?? "";
|
||||
|
||||
export const BACKUP_INTERVAL = Number(process.env.BACKUP_INTERVAL ?? "0");
|
||||
export const BACKUP_COPIES = Number(process.env.BACKUP_COPIES ?? "0");
|
||||
export const BACKUP_INTERVAL = Number(process.env.BACKUP_INTERVAL ?? "1");
|
||||
export const BACKUP_COPIES = Number(process.env.BACKUP_COPIES ?? "7");
|
||||
export const BACKUP_AUTO_RESTORE = process.env.BACKUP_AUTO_RESTORE ?? "true";
|
||||
|
||||
export function configCheck() {
|
||||
|
@ -60,6 +60,8 @@ export function configCheck() {
|
|||
|
||||
if (BACKUP_AUTO_RESTORE != "true" && BACKUP_AUTO_RESTORE != "false")
|
||||
throw new Error("set 'true' or 'false' to BACKUP_AUTO_RESTORE");
|
||||
if (BACKUP_INTERVAL < 1) throw new Error("BACKUP_INTERVAL has to be at least 1");
|
||||
if (BACKUP_COPIES < 1) throw new Error("BACKUP_COPIES has to be at least 1");
|
||||
}
|
||||
|
||||
function checkMS(input: string, origin: string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue