Skip to content

Commit

Permalink
feat: reduce scan interval
Browse files Browse the repository at this point in the history
Signed-off-by: Jian Zeng <[email protected]>
  • Loading branch information
knight42 committed Jan 3, 2024
1 parent ecfbaba commit dee59a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/server/repo_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ func (s *Server) handlerSyncRepo(c echo.Context) error {
if errors.Is(err, errNotFound) {
return newHTTPError(http.StatusNotFound, "Repo not found")
}
// https://github.com/moby/moby/issues/47018
var dkErr errdefs.ErrConflict
if errors.As(err, &dkErr) {
return newHTTPError(http.StatusConflict, "Repo is syncing")
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (s *Server) upgradeImages() {
func (s *Server) scheduleTasks(ctx context.Context) {
// sync repos
go func() {
ticker := time.NewTicker(time.Minute)
ticker := time.NewTicker(time.Second * 10)
defer ticker.Stop()
for {
var metas []model.RepoMeta
Expand Down

0 comments on commit dee59a0

Please sign in to comment.