wallet: logging, timestamp parsing backwards compatibility
This commit is contained in:
parent
89435696f9
commit
123b92b3aa
@ -323,6 +323,15 @@ export function durationAdd(d1: Duration, d2: Duration): Duration {
|
|||||||
|
|
||||||
export const codecForTimestamp: Codec<TalerProtocolTimestamp> = {
|
export const codecForTimestamp: Codec<TalerProtocolTimestamp> = {
|
||||||
decode(x: any, c?: Context): TalerProtocolTimestamp {
|
decode(x: any, c?: Context): TalerProtocolTimestamp {
|
||||||
|
// Compatibility, should be removed soon.
|
||||||
|
const t_ms = x.t_ms;
|
||||||
|
if (typeof t_ms === "string") {
|
||||||
|
if (t_ms === "never") {
|
||||||
|
return { t_s: "never" };
|
||||||
|
}
|
||||||
|
} else if (typeof t_ms === "number") {
|
||||||
|
return { t_s: Math.floor(t_ms / 1000) };
|
||||||
|
}
|
||||||
const t_s = x.t_s;
|
const t_s = x.t_s;
|
||||||
if (typeof t_s === "string") {
|
if (typeof t_s === "string") {
|
||||||
if (t_s === "never") {
|
if (t_s === "never") {
|
||||||
|
@ -818,9 +818,15 @@ async function processRefreshGroupImpl(
|
|||||||
logger.trace("processing refresh sessions for old coins");
|
logger.trace("processing refresh sessions for old coins");
|
||||||
const ps = refreshGroup.oldCoinPubs.map((x, i) =>
|
const ps = refreshGroup.oldCoinPubs.map((x, i) =>
|
||||||
processRefreshSession(ws, refreshGroupId, i).catch((x) => {
|
processRefreshSession(ws, refreshGroupId, i).catch((x) => {
|
||||||
|
if (x instanceof CryptoApiStoppedError) {
|
||||||
|
logger.info(
|
||||||
|
"crypto API stopped while processing refresh group, probably the wallet is during shutdown",
|
||||||
|
);
|
||||||
|
} else {
|
||||||
logger.warn("process refresh session got exception");
|
logger.warn("process refresh session got exception");
|
||||||
logger.warn(`exc ${x}`);
|
logger.warn(`exc ${x}`);
|
||||||
logger.warn(`exc stack ${x.stack}`);
|
logger.warn(`exc stack ${x.stack}`);
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user