some mirror fixed

This commit is contained in:
2025-10-28 12:59:54 +02:00
parent ac4b0ef47b
commit c8745e1f60
2 changed files with 7 additions and 0 deletions

2
install.sh Normal file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
env GOBIN=/usr/local/bin go install ./cmd

View File

@@ -67,6 +67,11 @@ func BatchInsertOnDuplicate(entries []model.ExternalSources, db *sqlx.DB, column
}
func (f *ExternalSources) GetTypeIds(entries []model.ExternalSources, db *sqlx.DB) []int {
if len(entries) == 0 {
fmt.Printf("Entries are empty")
return nil // або логування помилки
}
var typeIds []int
ids := thither.FieldValueToStrSlice(entries, "TypeId")
query := fmt.Sprintf("SELECT type_id FROM %s WHERE `type` = '%s' AND type_id IN (%s) LIMIT %d", constant.ExternalSourcesTable, entries[0].Type, strings.Join(ids, ","), len(ids))