This commit is contained in:
@@ -32,9 +32,17 @@ func (l *RateLogic) ProcessTask(ctx context.Context, _ *asynq.Task) error {
|
||||
CurrencyUnit string
|
||||
CurrencySymbol string
|
||||
AccessKey string
|
||||
FixedRate float64
|
||||
}{}
|
||||
tool.SystemConfigSliceReflectToStruct(currency, &configs)
|
||||
|
||||
// Check if fixed rate is enabled (greater than 0)
|
||||
if configs.FixedRate > 0 {
|
||||
l.svcCtx.ExchangeRate = configs.FixedRate
|
||||
logger.WithContext(ctx).Infof("[RateLogic] Use Fixed Exchange Rate: %f", configs.FixedRate)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Skip conversion if no exchange rate API key configured
|
||||
if configs.AccessKey == "" {
|
||||
logger.Debugf("[RateLogic] skip exchange rate, no access key configured")
|
||||
|
||||
Reference in New Issue
Block a user