created cleardatabase system

This commit is contained in:
DJj123dj
2022-05-02 11:35:41 +02:00
parent 92c1e8fce0
commit 8e7a98b810
29 changed files with 30 additions and 28 deletions
+28
View File
@@ -0,0 +1,28 @@
const fs = require('fs')
const dataPaths = ["./storage/tickets","./storage/transcripts","./storage/userTickets"]
var index = 0
dataPaths.forEach((path) => {
try {
fs.rmdirSync(path,{recursive:true,force:true})
}catch{
console.log(path,"doesn't exist")
}
setTimeout(() => {
try{
fs.mkdirSync(path)
}catch{
console.log(path,"already exists")
}
index++
},500)
})
setInterval(() => {
if (index >= 3){
console.log("All local data is cleared!")
process.exit(1)
}
},500)
+2 -1
View File
@@ -7,7 +7,8 @@
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"slashEnable":"node index.js slash enable",
"slashDisable":"node index.js slash disable"
"slashDisable":"node index.js slash disable",
"cleardata":"node ./core/dynamicdatabase/cleardata.js"
},
"author": "DJdj Development",
"license": "ISC",
-1
View File
@@ -1 +0,0 @@
1
-1
View File
@@ -1 +0,0 @@
0
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
858640346892337163
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469
-1
View File
@@ -1 +0,0 @@
779742674932072469