Documentation
¶
Index ¶
- Constants
- Variables
- func BalanceInternalKey(organizationID, ledgerID uuid.UUID, key string) string
- func FullJitter(baseDelay time.Duration) time.Duration
- func GenericInternalKey(name, contextName, organizationID, ledgerID, key string) string
- func NextBackoff(current time.Duration) time.Duration
- func TransactionInternalKey(organizationID, ledgerID uuid.UUID, key string) string
Constants ¶
View Source
const ( MaxRetries = 5 InitialBackoff = 500 * time.Millisecond MaxBackoff = 10 * time.Second BackoffFactor = 2.0 )
View Source
const BalanceSyncLockPrefix = "lock:{transactions}:balance-sync:"
View Source
const BalanceSyncScheduleKey = "schedule:{transactions}:balance-sync"
Variables ¶
View Source
var (
BalanceSynced = metrics.Metric{
Name: "balance_synced",
Unit: "1",
Description: "Measures the number of balances synced.",
}
)
Functions ¶
func BalanceInternalKey ¶ added in v3.3.6
BalanceInternalKey returns a key with the following format to be used on redis cluster: "balance:{contextName}:organizationID:ledgerID:key"
func FullJitter ¶
FullJitter returns a random delay between [0, baseDelay], capped by MaxBackoff.
func GenericInternalKey ¶ added in v3.3.6
GenericInternalKey returns a key with the following format to be used on redis cluster: "name:{contextName}:organizationID:ledgerID:key"
func NextBackoff ¶
NextBackoff calculates the next exponential backoff, respecting the MaxBackoff capped.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.