mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-30 20:35:09 +08:00
修复脚本管理数据
This commit is contained in:
+1
-11
@@ -2,6 +2,7 @@ import DataStore from 'nedb';
|
||||
import config from '../config';
|
||||
import Logger from './logger';
|
||||
import fs from 'fs';
|
||||
import { fileExist } from '../config/util';
|
||||
|
||||
interface Dbs {
|
||||
cronDb: DataStore;
|
||||
@@ -13,17 +14,6 @@ interface Dbs {
|
||||
|
||||
const db: Dbs = {} as any;
|
||||
|
||||
async function fileExist(file: any) {
|
||||
return new Promise((resolve) => {
|
||||
try {
|
||||
fs.accessSync(file);
|
||||
resolve(true);
|
||||
} catch (error) {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function truncateDb() {
|
||||
return new Promise(async (resolve) => {
|
||||
const files = [
|
||||
|
||||
Reference in New Issue
Block a user