Skip to content

Commit

Permalink
Merge pull request #773 from application-research/pm-check
Browse files Browse the repository at this point in the history
fix: call the queueManager checker from a go routine
  • Loading branch information
alvin-reyes authored Dec 14, 2022
2 parents 91c261b + 0f5affc commit 5e29e7b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions api/v1/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,9 @@ func (s *apiV1) handleEnsureReplication(c echo.Context) error {

fmt.Println("Content: ", content.Cid.CID, data)

s.CM.ToCheck(content.ID)
go func() {
s.CM.ToCheck(content.ID)
}()
return nil
}

Expand Down Expand Up @@ -4525,8 +4527,6 @@ func (s *apiV1) handleCreateContent(c echo.Context, u *util.User) error {
return err
}

defer s.CM.ToCheck(content.ID)

if req.CollectionID != "" {
if req.CollectionDir == "" {
req.CollectionDir = "/"
Expand All @@ -4547,6 +4547,10 @@ func (s *apiV1) handleCreateContent(c echo.Context, u *util.User) error {
}
}

go func() {
s.CM.ToCheck(content.ID)
}()

return c.JSON(http.StatusOK, util.ContentCreateResponse{
ID: content.ID,
})
Expand Down Expand Up @@ -4837,6 +4841,10 @@ func (s *apiV1) handleShuttleCreateContent(c echo.Context) error {
return err
}

go func() {
s.CM.ToCheck(content.ID)
}()

return c.JSON(http.StatusOK, util.ContentCreateResponse{
ID: content.ID,
})
Expand Down

0 comments on commit 5e29e7b

Please sign in to comment.