-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
39 lines (33 loc) · 785 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const AutoClean = require('./autocleaning');
main();
async function main(){
try{
var User = require('./config.json');
for(let i of User){
await getClient(i);
await sleep(7);
}
process.exit();
}
catch(err){
if(err.message.search('Cannot find module') != -1){
console.log('No config file, using standard input');
new AutoClean();
process.exit();
}
else{
console.error(err.message);
}
}
}
async function getClient(data) {
return new Promise(resolve=>{
new AutoClean(data);
resolve();
})
}
async function sleep(second) {
return new Promise(resolve=>{
setTimeout(resolve, second * 1000);
})
}