*Move ssl start logic to its own start function

This commit is contained in:
Derrick Hammer 2022-09-21 08:55:05 -04:00
parent e2ccfa5220
commit 650666515b
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 6 additions and 4 deletions

View File

@ -9,7 +9,6 @@ import { overwriteRegistryEntry } from "libskynetnode";
import type { DnsProvider } from "@lumeweb/relay-types"; import type { DnsProvider } from "@lumeweb/relay-types";
// @ts-ignore // @ts-ignore
import { hashDataKey } from "@lumeweb/kernel-utils"; import { hashDataKey } from "@lumeweb/kernel-utils";
import { getSslCheck } from "./ssl";
let activeIp: string; let activeIp: string;
const REGISTRY_NODE_KEY = "lumeweb-dht-node"; const REGISTRY_NODE_KEY = "lumeweb-dht-node";
@ -53,9 +52,6 @@ export async function start() {
); );
cron.schedule("0 * * * *", ipUpdate); cron.schedule("0 * * * *", ipUpdate);
if (config.bool("ssl") && getSslCheck()) {
await getSslCheck()();
}
} }
async function getCurrentIp(): Promise<string> { async function getCurrentIp(): Promise<string> {

View File

@ -143,3 +143,9 @@ export function setSSlCheck(checker: () => Promise<void>): void {
export function getSslCheck(): () => Promise<void> { export function getSslCheck(): () => Promise<void> {
return sslChecker; return sslChecker;
} }
export async function start() {
if (config.bool("ssl") && getSslCheck()) {
await getSslCheck()();
}
}