about summary refs log tree commit homepage
path: root/examples
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-17 13:40:07 +0900
committerEric Wong <e@80x24.org>2021-09-17 04:41:11 +0000
commitfe1b11bf5a752743167018f77e2826304ba0aa0e (patch)
tree955d2dad4b8ed11794f276f3c7ce5fcebadc8884 /examples
parent23ac27869da4744aba2a67454504b7a157583df7 (diff)
downloadpublic-inbox-fe1b11bf5a752743167018f77e2826304ba0aa0e.tar.gz
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.
Diffstat (limited to 'examples')
-rw-r--r--examples/public-inbox-httpd@.service3
1 files changed, 3 insertions, 0 deletions
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