fix(util): idle 500ms after kill rsync

This commit is contained in:
Haojun Liao 2024-05-31 18:41:20 +08:00
parent 923eaaa569
commit 5cbd733cab
1 changed files with 17 additions and 13 deletions

View File

@ -118,16 +118,20 @@ void stopRsync() {
#else #else
system("pkill rsync"); system("pkill rsync");
#endif #endif
if (code != 0) { if (code != 0) {
uError("[rsync] stop rsync server failed," ERRNO_ERR_FORMAT, ERRNO_ERR_DATA); uError("[rsync] stop rsync server failed," ERRNO_ERR_FORMAT, ERRNO_ERR_DATA);
return; } else {
}
uDebug("[rsync] stop rsync server successful"); uDebug("[rsync] stop rsync server successful");
} }
taosMsleep(500); // sleep 500 ms to wait for the completion of kill operation.
}
void startRsync() { void startRsync() {
if (taosMulMkDir(tsCheckpointBackupDir) != 0) { if (taosMulMkDir(tsCheckpointBackupDir) != 0) {
uError("[rsync] build checkpoint backup dir failed, dir:%s,"ERRNO_ERR_FORMAT, tsCheckpointBackupDir, ERRNO_ERR_DATA); uError("[rsync] build checkpoint backup dir failed, path:%s," ERRNO_ERR_FORMAT, tsCheckpointBackupDir,
ERRNO_ERR_DATA);
return; return;
} }
@ -147,10 +151,10 @@ void startRsync() {
code = system(cmd); code = system(cmd);
if (code != 0) { if (code != 0) {
uError("[rsync] start server failed, code:%d," ERRNO_ERR_FORMAT, code, ERRNO_ERR_DATA); uError("[rsync] start server failed, code:%d," ERRNO_ERR_FORMAT, code, ERRNO_ERR_DATA);
return; } else {
uDebug("[rsync] start server successful");
} }
uDebug("[rsync] start server successful");
} }
int32_t uploadByRsync(const char* id, const char* path) { int32_t uploadByRsync(const char* id, const char* path) {