mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 20:26:13 +01:00
refresh cache and insert repo to DB should be in one goroutine
This commit is contained in:
parent
7219544bba
commit
f22f102654
@ -71,12 +71,6 @@ func (n *NotificationHandler) Post() {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if action == "push" {
|
if action == "push" {
|
||||||
go func() {
|
|
||||||
if err := cache.RefreshCatalogCache(); err != nil {
|
|
||||||
log.Errorf("failed to refresh cache: %v", err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
exist := dao.RepositoryExists(repository)
|
exist := dao.RepositoryExists(repository)
|
||||||
if exist {
|
if exist {
|
||||||
@ -87,14 +81,11 @@ func (n *NotificationHandler) Post() {
|
|||||||
if err := dao.AddRepository(repoRecord); err != nil {
|
if err := dao.AddRepository(repoRecord); err != nil {
|
||||||
log.Errorf("Error happens when adding repository: %v", err)
|
log.Errorf("Error happens when adding repository: %v", err)
|
||||||
}
|
}
|
||||||
}()
|
if err := cache.RefreshCatalogCache(); err != nil {
|
||||||
|
log.Errorf("failed to refresh cache: %v", err)
|
||||||
operation := ""
|
|
||||||
if action == "push" {
|
|
||||||
operation = models.RepOpTransfer
|
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
go api.TriggerReplicationByRepository(repository, []string{tag}, operation)
|
go api.TriggerReplicationByRepository(repository, []string{tag}, models.RepOpTransfer)
|
||||||
}
|
}
|
||||||
if action == "pull" {
|
if action == "pull" {
|
||||||
go func() {
|
go func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user