(temp): migration (disable dual syncer)
Some checks failed
release / docker (push) Has been cancelled

This commit is contained in:
Mohamed Sohail 2025-03-24 12:17:26 +03:00
parent ef477c736f
commit 8b7e6ca8bc
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
2 changed files with 5 additions and 3 deletions

View File

@ -71,7 +71,7 @@ func main() {
wg.Add(1) wg.Add(1)
go func() { go func() {
defer wg.Done() defer wg.Done()
syncer.Run() // syncer.Run()
}() }()
<-ctx.Done() <-ctx.Done()
@ -80,7 +80,7 @@ func main() {
wg.Add(1) wg.Add(1)
go func() { go func() {
syncer.Stop() // syncer.Stop()
defer wg.Done() defer wg.Done()
}() }()

View File

@ -15,6 +15,7 @@ const syncInterval = time.Hour * 1
type ( type (
KVRow struct { KVRow struct {
ID int `db:"id"`
Key []byte `db:"key"` Key []byte `db:"key"`
Value []byte `db:"value"` Value []byte `db:"value"`
Updated time.Time `db:"updated"` Updated time.Time `db:"updated"`
@ -91,7 +92,8 @@ func (s *Syncer) Process(ctx context.Context) error {
} }
decodedValue := data.DecodeValue(row.Value) decodedValue := data.DecodeValue(row.Value)
s.logg.Debug("processing row", "key_type", decodedKeyDataType, "session_id", sessionID, "value", decodedValue, "timestamp", row.Updated, "column", column) s.logg.Info("processing row", "id", row.ID)
s.logg.Debug("processing row", "id", row.ID, "key_type", decodedKeyDataType, "session_id", sessionID, "value", decodedValue, "timestamp", row.Updated, "column", column)
query := fmt.Sprintf(` query := fmt.Sprintf(`
INSERT INTO ussd_data (phone_number, %s) INSERT INTO ussd_data (phone_number, %s)
VALUES ($1, $2) VALUES ($1, $2)