updates on the otp updates on the customer app

This commit is contained in:
2026-09-15 11:50:12 +05:30
parent e8f4c0a593
commit 89321c9e06
17 changed files with 1072 additions and 69 deletions

View File

@@ -5,6 +5,7 @@ import (
"database/sql"
"fmt"
"os"
"strings"
"time"
"doormile/config"
@@ -142,6 +143,17 @@ func InitRedis(cfg *config.Config) {
}
func InitNATS(cfg *config.Config) {
// No URL means NATS is deliberately not configured, so do not connect.
// This used to default to the production cluster, which meant any local
// run joined the live stream and competed with the real workers for the
// same durable pull consumer — messages got redelivered rather than lost,
// but it was production churn caused by someone running the repo.
if strings.TrimSpace(cfg.NatsURL) == "" {
utils.Info("NATS_URL is not set — running without NATS. " +
"Publishes are dropped and no consumer is started.")
return
}
var err error
Nc, err = nats.Connect(
cfg.NatsURL,