diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-12-19 20:42:49 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-12-19 20:42:49 +0100 |
commit | 0c9358c1b2bd80e25940022e86bd8daef8184ad7 (patch) | |
tree | a8c8ca0134bd886d8151633aff4c85e9513ad32c /src/util/timer.ts | |
parent | 49e3b3e5b9bbf1ce356ef68f301d50c689ceecb9 (diff) | |
download | wallet-core-0c9358c1b2bd80e25940022e86bd8daef8184ad7.tar.xz |
new date format, replace checkable annotations with codecs
Diffstat (limited to 'src/util/timer.ts')
-rw-r--r-- | src/util/timer.ts | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/util/timer.ts b/src/util/timer.ts index 865c17faf..000f36608 100644 --- a/src/util/timer.ts +++ b/src/util/timer.ts @@ -1,17 +1,19 @@ +import { Duration } from "./time"; + /* - This file is part of TALER - (C) 2017 GNUnet e.V. + This file is part of GNU Taler + (C) 2017-2019 Taler Systems S.A. - TALER is free software; you can redistribute it and/or modify it under the + GNU Taler is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. - TALER is distributed in the hope that it will be useful, but WITHOUT ANY + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ /** @@ -105,11 +107,13 @@ export class TimerGroup { } } - resolveAfter(delayMs: number): Promise<void> { + resolveAfter(delayMs: Duration): Promise<void> { return new Promise<void>((resolve, reject) => { - this.after(delayMs, () => { - resolve(); - }); + if (delayMs.d_ms !== "forever") { + this.after(delayMs.d_ms, () => { + resolve(); + }); + } }); } |