Skip to content
This repository was archived by the owner on Aug 2, 2020. It is now read-only.

Commit fc6adfb

Browse files
committed
Add clean_cache and clean_event params
1 parent 5cbe3f3 commit fc6adfb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/cqhttp/core/action.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ namespace cqhttp {
430430
HANDLER(set_restart) {
431431
const auto clean_log = params.get_bool("clean_log", false);
432432
const auto clean_cache = params.get_bool("clean_cache", false);
433+
const auto clean_event = params.get_bool("clean_event", false);
433434

434435
auto coolq_exe_path = cq::dir::root();
435436
if (const auto edition = get_coolq_edition(); edition == "air") {
@@ -451,11 +452,14 @@ namespace cqhttp {
451452
f << "del /f /s /q \"" << ansi(utils::fs::data_file_full_path(to_string(self_id), "logv1.db")) << "\""
452453
<< endl;
453454
}
454-
// due to issue #95, we temporarily disable "clean_cache" option
455-
// if (clean_cache) {
456-
// f << "rmdir /s /q \"" << ansi(utils::fs::data_file_full_path(to_string(self_id), "")) << "\"" <<
457-
// endl;
458-
// }
455+
if (clean_cache) {
456+
f << "del /f /s /q \"" << ansi(utils::fs::data_file_full_path(to_string(self_id), "cache.db")) << "\""
457+
<< endl;
458+
}
459+
if (clean_event) {
460+
f << "del /f /s /q \"" << ansi(utils::fs::data_file_full_path(to_string(self_id), "eventv2.db")) << "\""
461+
<< endl;
462+
}
459463
f << "start \"\" \"" << ansi(coolq_exe_path) << "\" /account " << self_id << endl;
460464
}
461465

0 commit comments

Comments
 (0)