add SyncService check

This commit is contained in:
c9s 2021-04-09 12:44:30 +08:00
parent 34fe915a9f
commit 2ec4617694

View File

@ -533,6 +533,10 @@ func (environ *Environment) Sync(ctx context.Context) error {
}
func (environ *Environment) SyncSession(ctx context.Context, session *ExchangeSession, defaultSymbols ...string) error {
if environ.SyncService == nil {
return nil
}
environ.syncMutex.Lock()
defer environ.syncMutex.Unlock()