diff options
author | Eric Wong <e@80x24.org> | 2019-06-24 02:52:04 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-24 05:26:25 +0000 |
commit | 860c7e13d31390dc16c2cce813e4887f12e76731 (patch) | |
tree | b24f266351b82ac70a180a71cb04fa43e84639f3 /lib/PublicInbox/NNTP.pm | |
parent | 8c619bae62a3d468505716d58d3559278883eee7 (diff) | |
download | public-inbox-860c7e13d31390dc16c2cce813e4887f12e76731.tar.gz |
All of our internal timing code should use monotonic clocks for consistency against system clock adjustments. This can be shared by our Daemon and NNTP packages.
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r-- | lib/PublicInbox/NNTP.pm | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 107cbe31..0a473e42 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -14,7 +14,7 @@ use PublicInbox::Git; require PublicInbox::EvCleanup; use Email::Simple; use POSIX qw(strftime); -use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC); +PublicInbox::DS->import('now'); use Digest::SHA qw(sha1_hex); use Time::Local qw(timegm timelocal); use constant { @@ -25,8 +25,6 @@ use constant { r430 => '430 No article with that message-id', }; -sub now () { clock_gettime(CLOCK_MONOTONIC) }; - my @OVERVIEW = qw(Subject From Date Message-ID References Xref); my $OVERVIEW_FMT = join(":\r\n", @OVERVIEW, qw(Bytes Lines)) . ":\r\n"; my $LIST_HEADERS = join("\r\n", @OVERVIEW, |