diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-03-14 01:10:36 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-03-14 01:10:36 +0100 |
commit | f9124f6e077d0bc01c0158f2554ac9605cdfc746 (patch) | |
tree | cb5527629cb5585abfdf8aac354cfe6551b9fc9a | |
parent | 7b01c04086c8c689f0b40680464be69c3335f8f1 (diff) | |
download | server-f9124f6e077d0bc01c0158f2554ac9605cdfc746.tar.gz |
Don't use chokidar.
It's unreliable and regularly misses file changes on the production server.
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | server.js | 7 |
2 files changed, 4 insertions, 4 deletions
diff --git a/package.json b/package.json index 8a50d86..aa1885a 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "dependencies": { "better-sqlite3": "^9.4.1", "bufferutil": "^4.0.8", - "chokidar": "^3.6.0", "dotenv": "^16.4.4", "express": "^4.18.2", "nodemailer": "^6.9.9", @@ -9,7 +9,6 @@ const https = require("https") // for webhook requests const { WebSocketServer } = require("ws") const express = require("express") const url = require("url") -const chokidar = require("chokidar") const sqlite3 = require("better-sqlite3") require("dotenv").config() @@ -1197,8 +1196,10 @@ function watch_rules(rules_dir, rules_file, title) { } } - // ALSO: for (let file of watch_list) fs.watchFile(file, reload_rules) - chokidar.watch(watch_list, { ignoreInitial: true, awaitWriteFinish: true }).on("all", reload_rules) + // TODO: figure out why chokidar is unreliable on production server + // chokidar.watch(watch_list, { ignoreInitial: true, awaitWriteFinish: true }).on("all", reload_rules) + for (let file of watch_list) + fs.watchFile(file, reload_rules) } function load_titles() { |