Remove updateInfo imports from old version and add to gitignore
This commit is contained in:
+6
-1
@@ -11,4 +11,9 @@ package-lock.json
|
||||
|
||||
/uploads
|
||||
files.db
|
||||
users.db
|
||||
users.db
|
||||
|
||||
/pvfiles
|
||||
/staticfiles
|
||||
|
||||
.env
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Express, Request, Response } from "express";
|
||||
import Logger from "../util/Logger";
|
||||
import "../updateInfo";
|
||||
import bcrypt from "bcrypt";
|
||||
import { db } from "../util/database";
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Express, Request, Response } from "express";
|
||||
import Logger from "../util/Logger";
|
||||
import "../updateInfo";
|
||||
import bcrypt from "bcrypt";
|
||||
import { db } from "../util/database";
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Express, Request, Response, json } from "express";
|
||||
import Logger from '../util/Logger'
|
||||
import '../updateInfo'
|
||||
var c = new Logger("Server(Pages)", "gray")
|
||||
|
||||
import dotenv from "dotenv";
|
||||
|
||||
+20
-18
@@ -43,19 +43,19 @@ export function bytesToSize(bytes: number, decimals = 2) {
|
||||
)} ${sizes[index]}`;
|
||||
}
|
||||
|
||||
function waitUntil(conditionFn: () => boolean, interval = 100): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
const timer = setInterval(() => {
|
||||
try {
|
||||
if (conditionFn()) {
|
||||
clearInterval(timer);
|
||||
resolve();
|
||||
}
|
||||
} catch (err) {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, interval);
|
||||
});
|
||||
export function waitUntil(conditionFn: () => boolean, interval = 100): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
const timer = setInterval(() => {
|
||||
try {
|
||||
if (conditionFn()) {
|
||||
clearInterval(timer);
|
||||
resolve();
|
||||
}
|
||||
} catch (err) {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, interval);
|
||||
});
|
||||
}
|
||||
|
||||
import fs from 'fs'
|
||||
@@ -74,13 +74,15 @@ export async function mkDirsManIfNotExists(paths: string[]): Promise<boolean> {
|
||||
try {
|
||||
var pass = false
|
||||
|
||||
for (const path in paths) {
|
||||
await waitUntil(() => pass = true)
|
||||
|
||||
paths.forEach((path: string) => {
|
||||
//await waitUntil(() => pass = true)
|
||||
|
||||
pass = false
|
||||
if (!fs.existsSync(path))
|
||||
if (!fs.existsSync(path)) {
|
||||
console.log("Path does not exist: " + path)
|
||||
fs.mkdir(path, () => pass = true);
|
||||
}
|
||||
}
|
||||
})
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user