Switch to 'fs/promises'

This commit is contained in:
I-Have-An-Issue 2023-02-12 19:00:53 -05:00
parent 52a8be910a
commit 574778f49a
No known key found for this signature in database
GPG Key ID: E55435DEA0825091
2 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
const axios = require("axios")
const { readFileSync } = require("fs")
const { readFile } = require("fs/promises")
const Job = require("./Job.js")
const logger = require("../logger.js")
@ -25,7 +25,7 @@ class GameJob extends Job {
this.OpenJobEx({
name: this.id,
script: readFileSync(__dirname + "/../../lua/gameserver.lua", { encoding: "utf-8" }),
script: await readFile(__dirname + "/../../lua/gameserver.lua", { encoding: "utf-8" }),
arguments: {
LuaValue: [
{ type: "LUA_TSTRING", value: this.id },

View File

@ -1,4 +1,4 @@
const { readFileSync } = require("fs")
const { readFile } = require("fs/promises")
const Job = require("./Job.js")
const logger = require("../logger.js")
@ -17,7 +17,7 @@ class RenderJob extends Job {
const result = await this.OpenJobEx({
name: this.id,
script: readFileSync(__dirname + "/../../lua/headshot.lua", { encoding: "utf-8" }),
script: await readFile(__dirname + "/../../lua/headshot.lua", { encoding: "utf-8" }),
arguments: {
LuaValue: [
{ type: "LUA_TSTRING", value: this.id },
@ -52,7 +52,7 @@ class RenderJob extends Job {
const result = await this.OpenJobEx({
name: this.id,
script: readFileSync(__dirname + "/../../lua/bodyshot.lua", { encoding: "utf-8" }),
script: await readFile(__dirname + "/../../lua/bodyshot.lua", { encoding: "utf-8" }),
arguments: {
LuaValue: [
{ type: "LUA_TSTRING", value: this.id },
@ -87,7 +87,7 @@ class RenderJob extends Job {
const result = await this.OpenJobEx({
name: this.id,
script: readFileSync(__dirname + "/../../lua/xml.lua", { encoding: "utf-8" }),
script: await readFile(__dirname + "/../../lua/xml.lua", { encoding: "utf-8" }),
arguments: {
LuaValue: [
{ type: "LUA_TSTRING", value: this.id },
@ -128,7 +128,7 @@ class RenderJob extends Job {
const result = await this.OpenJobEx({
name: this.id,
script: readFileSync(__dirname + "/../../lua/place.lua", { encoding: "utf-8" }),
script: await readFile(__dirname + "/../../lua/place.lua", { encoding: "utf-8" }),
arguments: {
LuaValue: [
{ type: "LUA_TSTRING", value: this.id },