update
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s

This commit is contained in:
2026-10-11 01:13:58 +02:00
parent 0c5013f4a8
commit 58b26304ae
9 changed files with 127300 additions and 168 deletions
+15 -9
View File
@@ -28,20 +28,26 @@ var syncCmd = &cobra.Command{
if config.Verbose > 2 {
slog.Info("Size of targetData", "size", reflect.TypeOf(targetData).Size())
}
// find missing items in target and collect items not available in source
for table, item_list := range sourceData.GetMap() {
slog.Info("iterate sourceData", "table", table, "count", reflect.TypeOf(item_list).Size())
switch table {
case "sports":
sourceData.Sport.CompareIds(&targetData.Sport)
case "players":
sourceData.Player.CompareIds(&targetData.Player)
slog.Info("iterate sourceData", "table", "Sport", "count", len(sourceData.Sport))
sourceData.Sport.CompareIds(&targetData.Sport)
slog.Info("iterate sourceData", "table", "Player", "count", len(sourceData.Player))
sourceData.Player.CompareIds(&targetData.Player)
slog.Info("iterate sourceData", "table", "MediaLofi", "count source", len(sourceData.MediaLoFi), "count target", len(targetData.MediaLoFi))
missing, obsolete := sourceData.MediaLoFi.CompareIds(&targetData.MediaLoFi)
for _, lofi_id := range missing {
if !config.DryRun {
slog.Info("add MediaLofi", "id", lofi_id)
}
}
for _, lofi_id := range obsolete {
if !config.DryRun {
slog.Info("delete MediaLofi", "id", lofi_id)
}
}
},
}
func init() {
rootCmd.AddCommand(syncCmd)
syncCmd.PersistentFlags().BoolVarP(&config.DryRun, "dry-run", "m", false, "do not execute data changes")
}