Explorar o código

prevent any kind of operation simultaneously

Victor Vieux %!s(int64=12) %!d(string=hai) anos
pai
achega
2db99441c8
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      server.go

+ 3 - 0
server.go

@@ -477,6 +477,9 @@ func (srv *Server) poolAdd(kind, key string) error {
 	if _, exists := srv.pullingPool[key]; exists {
 		return fmt.Errorf("pull %s is already in progress", key)
 	}
+	if _, exists := srv.pushingPool[key]; exists {
+		return fmt.Errorf("push %s is already in progress", key)
+	}
 
 	switch kind {
 	case "pull":