fix(task): race condition in creating and finding meta data fixed (#828)
parent
d26b7aba39
commit
8cc55b3a37
|
@ -226,6 +226,9 @@ func (s *inmem) DisableTask(ctx context.Context, id platform.ID) error {
|
|||
}
|
||||
|
||||
func (s *inmem) FindTaskMetaByID(ctx context.Context, id platform.ID) (*StoreTaskMeta, error) {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
|
||||
meta, ok := s.runners[id.String()]
|
||||
if !ok {
|
||||
return nil, errors.New("task meta not found")
|
||||
|
|
Loading…
Reference in New Issue