fix: sync api guard condition

This commit is contained in:
ycdesu 2022-06-15 11:44:39 +08:00
parent ea88e84445
commit bee85f7973

View File

@ -77,7 +77,7 @@ func (s *Server) newEngine(ctx context.Context) *gin.Engine {
})
r.POST("/api/environment/sync", func(c *gin.Context) {
if s.Environ.IsSyncing() == bbgo.SyncDone {
if s.Environ.IsSyncing() != bbgo.Syncing {
go func() {
// We use the root context here because the syncing operation is a background goroutine.
// It should not be terminated if the request is disconnected.