Conversation
Codecov Report
@@ Coverage Diff @@
## main #350 +/- ##
==========================================
- Coverage 54.12% 53.05% -1.08%
==========================================
Files 50 51 +1
Lines 3100 3163 +63
==========================================
Hits 1678 1678
- Misses 1239 1302 +63
Partials 183 183
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
|
||
| result := []models.Invoice{} | ||
| err = dbConn.NewSelect().Model(&result).Where("id > ?", startId).Where("id < ?", endId).Scan(context.Background()) | ||
| err = dbConn.NewSelect().Model(&result).Where("settled_at > ?", startDate).Where("settled_at < ?", endDate).Scan(context.Background()) |
There was a problem hiding this comment.
we only publish settled invoices, correct? thus it's ok to check settled there?
There was a problem hiding this comment.
If settled_at is between those 2 values, then it's settled.
| if dryRun { | ||
| continue | ||
| } | ||
| err = svc.RabbitMQClient.PublishToLndhubExchange(context.Background(), inv, svc.EncodeInvoiceWithUserLogin) |
There was a problem hiding this comment.
is it OK to flood the queue? or do we need some slight delay?
but I guess it should be OK.
republish_invoices/main.go
Outdated
| logrus.Error(err) | ||
| } | ||
| } | ||
| logrus.Infof("Published %d invoices", len(result)) |
There was a problem hiding this comment.
should we count which ones did not have an error to be able to see if all have been published.
republish_invoices/main.go
Outdated
| } | ||
| err = svc.RabbitMQClient.PublishToLndhubExchange(context.Background(), inv, svc.EncodeInvoiceWithUserLogin) | ||
| if err != nil { | ||
| logrus.Error(err) |
There was a problem hiding this comment.
I guess this is an exception and could be a sentry notification? (though this floods sentry) - should we cancel if the publishing fails?
There was a problem hiding this comment.
Don't think we should cancel.
| "github.com/getAlby/lndhub.go/rabbitmq" | ||
| "github.com/joho/godotenv" | ||
| "github.com/kelseyhightower/envconfig" | ||
| "github.com/sirupsen/logrus" |
There was a problem hiding this comment.
It's the same logger. It's what we use under the hood.
There was a problem hiding this comment.
how does it work? we initialize one here that we then use I think: https://github.com/getAlby/lndhub.go/blob/main/main.go#L80
| rabbitmq.WithLndInvoiceExchange(c.RabbitMQLndInvoiceExchange), | ||
| rabbitmq.WithLndHubInvoiceExchange(c.RabbitMQLndhubInvoiceExchange), | ||
| rabbitmq.WithLndInvoiceConsumerQueueName(c.RabbitMQInvoiceConsumerQueueName), | ||
| ) |
There was a problem hiding this comment.
should this be a function like getRabbitmqClient to make sure we have the same client config everwhere?
|
generally I would like to move towards JSON logging which helps querying log entries. |
No description provided.