wallet-core: fix computation of timestamp for exchange update
This commit is contained in:
parent
afaeefb943
commit
02bbf08283
@ -539,6 +539,10 @@ export interface ExchangeRecord {
|
||||
*/
|
||||
nextRefreshCheck: Timestamp;
|
||||
|
||||
/**
|
||||
* Last error (if any) for fetching updated information about the
|
||||
* exchange.
|
||||
*/
|
||||
lastError?: TalerErrorDetails;
|
||||
|
||||
/**
|
||||
|
@ -52,10 +52,18 @@ async function gatherExchangePending(
|
||||
resp: PendingOperationsResponse,
|
||||
): Promise<void> {
|
||||
await tx.exchanges.iter().forEachAsync(async (e) => {
|
||||
let exchangeUpdateTimestampDue: Timestamp;
|
||||
|
||||
if (e.lastError) {
|
||||
exchangeUpdateTimestampDue = e.retryInfo.nextRetry;
|
||||
} else {
|
||||
exchangeUpdateTimestampDue = e.nextUpdate;
|
||||
}
|
||||
|
||||
resp.pendingOperations.push({
|
||||
type: PendingTaskType.ExchangeUpdate,
|
||||
givesLifeness: false,
|
||||
timestampDue: e.nextUpdate,
|
||||
timestampDue: exchangeUpdateTimestampDue,
|
||||
exchangeBaseUrl: e.baseUrl,
|
||||
lastError: e.lastError,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user