🔧 Update Go version in go.mod and enhance build process with versioning information. Modify Makefile and Taskfile to inject build metadata (version, commit, build time) into the binary. Improve README with instructions for custom version builds and document new build info features. Add benchmarks for message parsing and processing to improve performance testing capabilities.

This commit is contained in:
windyboy
2025-11-18 14:15:58 +08:00
parent 7f44b5389d
commit 06fc9cb9e0
27 changed files with 3009 additions and 55 deletions
+5 -1
View File
@@ -37,6 +37,10 @@ func ProvideRepository(pool *pgxpool.Pool, logger *zap.Logger) (port.Repository,
// InsertOne inserts a single telegram message
func (r *Repository) InsertOne(ctx context.Context, msg *dto.ParsedTelegram) error {
if msg == nil {
return fmt.Errorf("message cannot be nil")
}
ctx, span := otel.Tracer("caatsm/postgres").Start(ctx, "Repository.InsertOne")
defer span.End()
@@ -53,7 +57,7 @@ func (r *Repository) InsertOne(ctx context.Context, msg *dto.ParsedTelegram) err
// Optional idempotency check based on business message identity. If we have a
// non-empty message ID and date/time, we can cheaply skip duplicates here to
// avoid applying the same business event multiple times.
if msg != nil && msg.MessageID != "" && msg.DateTime != "" {
if msg.MessageID != "" && msg.DateTime != "" {
exists, err := r.messageExists(ctx, msg.MessageID, msg.DateTime)
if err != nil {
span.RecordError(err)