From 4f17f95978ad84e898fa9f6004b70e14ebc69048 Mon Sep 17 00:00:00 2001 From: Patrick Pfeiffer Date: Thu, 26 Sep 2024 10:40:29 +0200 Subject: [PATCH] chore(userservice): report status on app_subscriptions_check and stripe_email_updater --- backend/pkg/userservice/appsubscription_oracle.go | 3 +++ backend/pkg/userservice/stripe_email_updater.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/backend/pkg/userservice/appsubscription_oracle.go b/backend/pkg/userservice/appsubscription_oracle.go index 342f5d181..7dbf2e1a7 100644 --- a/backend/pkg/userservice/appsubscription_oracle.go +++ b/backend/pkg/userservice/appsubscription_oracle.go @@ -12,6 +12,7 @@ import ( "github.com/gobitfly/beaconchain/pkg/commons/db" "github.com/gobitfly/beaconchain/pkg/commons/log" "github.com/gobitfly/beaconchain/pkg/commons/metrics" + "github.com/gobitfly/beaconchain/pkg/commons/services" "github.com/gobitfly/beaconchain/pkg/commons/types" "github.com/gobitfly/beaconchain/pkg/commons/utils" @@ -93,6 +94,8 @@ func CheckMobileSubscriptions() { updateValidationState(receipt, valid) } + services.ReportStatus("app_subscriptions_check", "Running", nil) + log.InfoWithFields(log.Fields{"subscriptions": len(receipts), "duration": time.Since(start)}, "subscription update completed") time.Sleep(time.Hour * 4) } diff --git a/backend/pkg/userservice/stripe_email_updater.go b/backend/pkg/userservice/stripe_email_updater.go index 2f790e20f..f539c8bd6 100644 --- a/backend/pkg/userservice/stripe_email_updater.go +++ b/backend/pkg/userservice/stripe_email_updater.go @@ -10,6 +10,7 @@ import ( "github.com/gobitfly/beaconchain/pkg/commons/db" "github.com/gobitfly/beaconchain/pkg/commons/log" + "github.com/gobitfly/beaconchain/pkg/commons/services" "github.com/gobitfly/beaconchain/pkg/commons/utils" "github.com/lib/pq" ) @@ -50,6 +51,8 @@ func StripeEmailUpdater() { } } + services.ReportStatus("stripe_email_updater", "Running", nil) + time.Sleep(time.Minute) } }