From fe1b11bf5a752743167018f77e2826304ba0aa0e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 17 Sep 2021 13:40:07 +0900 Subject: search: fix rt: w/ approxidate when TZ != UTC While git respects a user's local timezone and returns seconds-since-the-Epoch, we were unnecessarily and incorrectly calling gmtime+strftime on its result. So ignore calling gmtime+strftime when the strftime format is "%s", just feed the output time from git directly to Xapian. This is mainly for lei, which will likely run in a variety of timezones. While we're at it, add a recommendation to use TZ=UTC in public-inbox-httpd, in case there are (misguided :P) sysadmins who set a non-UTC TZ. --- examples/public-inbox-httpd@.service | 3 +++ 1 file changed, 3 insertions(+) (limited to 'examples') diff --git a/examples/public-inbox-httpd@.service b/examples/public-inbox-httpd@.service index e811da40..147f7c6d 100644 --- a/examples/public-inbox-httpd@.service +++ b/examples/public-inbox-httpd@.service @@ -4,6 +4,8 @@ # (e.g. public-inbox-httpd@1 public-inbox-httpd@2) with the intention # that they take turns running in-between upgrades. This should # allow upgrading without downtime. +# For servers expecting visitors from multiple timezones, TZ=UTC +# is needed to ensure a consistent approxidate experience with search. [Unit] Description = public-inbox PSGI server %i @@ -13,6 +15,7 @@ After = public-inbox-httpd.socket [Service] Environment = PI_CONFIG=/home/pi/.public-inbox/config \ PATH=/usr/local/bin:/usr/bin:/bin \ +TZ=UTC \ PERL_INLINE_DIRECTORY=/tmp/.pub-inline LimitNOFILE = 30000 -- cgit v1.2.3-24-ge0c7