Move config files to new directory
This commit is contained in:
parent
6a409283af
commit
81ff5ae0ab
11 changed files with 10 additions and 10 deletions
|
@ -8,7 +8,7 @@ export const jobs = {};
|
|||
|
||||
export const connections = new Map();
|
||||
|
||||
export const servers = JSON.parse(fs.readFileSync(new URL("../servers.json", import.meta.url), { encoding: "utf8" })).image;
|
||||
export const servers = JSON.parse(fs.readFileSync(new URL("../config/servers.json", import.meta.url), { encoding: "utf8" })).image;
|
||||
|
||||
export async function getType(image, extraReturnTypes) {
|
||||
if (!image.startsWith("http")) {
|
||||
|
|
|
@ -24,7 +24,7 @@ export async function clean(text) {
|
|||
.replaceAll("@", `@${String.fromCharCode(8203)}`);
|
||||
|
||||
const { parsed } = config();
|
||||
const imageServers = JSON.parse(fs.readFileSync(new URL("../servers.json", import.meta.url), { encoding: "utf8" })).image;
|
||||
const imageServers = JSON.parse(fs.readFileSync(new URL("../config/servers.json", import.meta.url), { encoding: "utf8" })).image;
|
||||
|
||||
if (imageServers?.length !== 0) {
|
||||
for (const { server, auth } of imageServers) {
|
||||
|
|
|
@ -23,7 +23,7 @@ class ImageWorker extends BaseServiceWorker {
|
|||
|
||||
if (process.env.API_TYPE === "ws") {
|
||||
this.connections = new Map();
|
||||
this.servers = JSON.parse(fs.readFileSync(new URL("../../servers.json", import.meta.url), { encoding: "utf8" })).image;
|
||||
this.servers = JSON.parse(fs.readFileSync(new URL("../../config/servers.json", import.meta.url), { encoding: "utf8" })).image;
|
||||
this.nextID = 0;
|
||||
} else if (process.env.API_TYPE === "azure") {
|
||||
this.jobs = new Map();
|
||||
|
@ -115,7 +115,7 @@ class ImageWorker extends BaseServiceWorker {
|
|||
}
|
||||
|
||||
async repopulate() {
|
||||
const data = await fs.promises.readFile(new URL("../../servers.json", import.meta.url), { encoding: "utf8" });
|
||||
const data = await fs.promises.readFile(new URL("../../config/servers.json", import.meta.url), { encoding: "utf8" });
|
||||
this.servers = JSON.parse(data).image;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ export let status = false;
|
|||
export let connected = false;
|
||||
|
||||
export async function checkStatus() {
|
||||
const json = await fs.promises.readFile(new URL("../servers.json", import.meta.url), { encoding: "utf8" });
|
||||
const json = await fs.promises.readFile(new URL("../config/servers.json", import.meta.url), { encoding: "utf8" });
|
||||
nodes = JSON.parse(json).lava;
|
||||
const newNodes = [];
|
||||
for (const node of nodes) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue