mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
fix: more logging for sync extension (#3656)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
This commit is contained in:
@@ -26,6 +26,8 @@ func EnableSyncExtension(config *config.Config, metaDB mTypes.MetaDB,
|
||||
httpPort := config.GetHTTPPort()
|
||||
|
||||
if extensionsConfig.IsSyncEnabled() {
|
||||
log.Info().Msg("sync extension is enabled")
|
||||
|
||||
onDemand := sync.NewOnDemand(log)
|
||||
syncConfig := extensionsConfig.GetSyncConfig()
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ func (registry *RemoteRegistry) GetRepositories(ctx context.Context) ([]string,
|
||||
continue
|
||||
}
|
||||
|
||||
registry.log.Debug().Strs("repoList", repoList).Str("remote", host.Name).Msg("listed repositories in remote registry")
|
||||
|
||||
return repoList, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ func (gen *TaskGenerator) Next() (scheduler.Task, error) {
|
||||
gen.resetWaitTime()
|
||||
|
||||
if repo == "" {
|
||||
gen.log.Info().Str("component", "sync").Msg("finished syncing all repositories")
|
||||
gen.log.Info().Str("component", "sync").Msg("finished generating tasks to sync repositories")
|
||||
gen.done = true
|
||||
|
||||
return nil, nil //nolint:nilnil
|
||||
|
||||
@@ -7869,7 +7869,7 @@ func pushBlob(url string, repoName string, buf []byte) godigest.Digest {
|
||||
// this is waiting for generator to finish working, it doesn't mean sync has finished though.
|
||||
func waitSyncFinish(logPath string) bool {
|
||||
found, err := test.ReadLogFileAndSearchString(logPath,
|
||||
"finished syncing all repos", 60*time.Second)
|
||||
"finished generating tasks to sync repositories", 60*time.Second)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ function teardown() {
|
||||
start=`date +%s`
|
||||
echo "waiting for sync to finish" >&3
|
||||
|
||||
run wait_for_string "finished syncing all repos" ${ZOT_LOG_FILE} "5m"
|
||||
run wait_for_string "finished generating tasks to sync repositories" ${ZOT_LOG_FILE} "5m"
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
end=`date +%s`
|
||||
|
||||
Reference in New Issue
Block a user