save wait
This commit is contained in:
parent
55d0215d02
commit
84d001c066
2 changed files with 12 additions and 4 deletions
|
@ -17,6 +17,7 @@ import { addGetMethods } from "./api/get.js";
|
|||
import { activatePost, addPostMethods } from "./api/post.js";
|
||||
import { activateWS, wsOnConnection } from "./api/ws.js";
|
||||
import { startUpdateCert } from "./server/serverCerts.js";
|
||||
import { wait } from "./sys/tools.js";
|
||||
|
||||
|
||||
const config = {
|
||||
|
@ -98,8 +99,9 @@ async function startServer() {
|
|||
|
||||
async function complete_loaded() {
|
||||
startUpdateCert();
|
||||
await wait(500);
|
||||
let succ = await generateTag();
|
||||
if(!succ) error("Outbag", "Could not resolve own Server Tag. Remote-Auth will not work! Check if the Server is reachable and the config ist correct!");
|
||||
if(!succ) error("Outbag", "Could not check own Server Tag. Remote-Auth will not work! Check if the Server is reachable and the config ist correct!");
|
||||
activatePost();
|
||||
activateWS();
|
||||
log("Server", 'Listening...');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import crypto from "crypto";
|
||||
|
||||
export const uts = ()=>{
|
||||
return Math.floor(new Date().getTime()/1000);
|
||||
export const uts = () => {
|
||||
return Math.floor(new Date().getTime() / 1000);
|
||||
}
|
||||
|
||||
const key64 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-";
|
||||
|
@ -14,4 +14,10 @@ export const get64 = (l: number) => {
|
|||
out += key64[val[i] % key64.length];
|
||||
}
|
||||
return out;
|
||||
};
|
||||
};
|
||||
|
||||
export const wait = (ms: number) => {
|
||||
return new Promise((res)=>{
|
||||
setTimeout(res,ms);
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue