This commit is contained in:
Hongze Cheng 2023-06-26 16:38:26 +08:00
parent 5a0218d1ca
commit 3172306f65
1 changed files with 4 additions and 0 deletions

View File

@ -781,6 +781,10 @@ static int32_t tsdbFSRunBgTask(void *arg) {
static int32_t tsdbFSScheduleBgTaskImpl(STFileSystem *fs, EFSBgTaskT type, int32_t (*run)(void *), void *arg, static int32_t tsdbFSScheduleBgTaskImpl(STFileSystem *fs, EFSBgTaskT type, int32_t (*run)(void *), void *arg,
int64_t *taskid) { int64_t *taskid) {
if (fs->stop) {
return 0; // TODO: use a better error code
}
// check if same task is on // check if same task is on
if (fs->bgTaskRunning && fs->bgTaskRunning->type == type) { if (fs->bgTaskRunning && fs->bgTaskRunning->type == type) {
return 0; return 0;