fix: 修复数据库备份与恢复问题 (#85)

* fix: 修复数据库备份与恢复问题

* fix: 修复数据库备份与恢复问题
This commit is contained in:
kanzihuang
2024-01-15 20:11:28 +08:00
committed by GitHub
parent b873855b44
commit c0232c4c75
12 changed files with 53 additions and 32 deletions

View File

@@ -54,7 +54,10 @@ func (nt *NullTime) MarshalJSON() ([]byte, error) {
}
func SleepWithContext(ctx context.Context, d time.Duration) {
ctx, cancel := context.WithTimeout(ctx, d)
<-ctx.Done()
cancel()
timer := time.NewTimer(d)
defer timer.Stop()
select {
case <-timer.C:
case <-ctx.Done():
}
}