summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-08-11 19:56:52 +0200
committerTor Andersson <tor@ccxvii.net>2023-08-11 19:59:29 +0200
commit9096b626446b83dc545285146bdaa394dbac5ef3 (patch)
tree86d2ba9d318a594ff027f4f04cec37ab9bc846da /server.js
parent1a90cb82b461568579e481f90b536e5cbd4fbf50 (diff)
downloadserver-9096b626446b83dc545285146bdaa394dbac5ef3.tar.gz
Remove backup dance.
Use VACUUM INTO 'backup.db' instead.
Diffstat (limited to 'server.js')
-rw-r--r--server.js25
1 files changed, 0 insertions, 25 deletions
diff --git a/server.js b/server.js
index 38093c0..66183d8 100644
--- a/server.js
+++ b/server.js
@@ -2471,28 +2471,3 @@ app.get('/user-stats/:who_name', function (req, res) {
return res.status(404).send("Invalid user name.")
}
})
-
-function backup_run() {
- let start = Date.now()
- console.log("BACKUP STARTED")
- db.backup("backup.tmp")
- .then(() => {
- fs.renameSync("backup.tmp", "backup.db")
- console.log("BACKUP FINISHED", Date.now() - start + "ms")
- })
- .catch((err) => {
- console.log("BACKUP FAILED", err)
- })
-}
-
-function backup_heartbeat() {
- try {
- fs.accessSync("backup.request", fs.constants.R_OK)
- fs.unlinkSync("backup.request")
- backup_run()
- } catch (err) {
- // no file exists!
- }
-}
-
-setInterval(backup_heartbeat, 60 * 1000)