completed adding MediaLofi for kontor-gin
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -19,18 +19,23 @@ var syncCmd = &cobra.Command{
|
||||
slog.Info("sync kontor")
|
||||
apiVersion := viper.GetString("api")
|
||||
mainServer := config.Config.Server["main"]
|
||||
slog.Info("syncCmd#Run", "mainServer", mainServer)
|
||||
if config.Verbose > 2 {
|
||||
slog.Info("syncCmd#Run", "mainServer", mainServer)
|
||||
}
|
||||
localServer := config.Config.Server["local"]
|
||||
sourceData, _ := api.GetData(mainServer, apiVersion)
|
||||
targetData, _ := api.GetData(localServer, apiVersion)
|
||||
slog.Info("Size of targetData", "size", reflect.TypeOf(targetData).Size())
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user