This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 55e2d4ce Ensure mtime is set, and can be read
55e2d4ce is described below
commit 55e2d4cee10bc71ff283e478fa91de749dc6d777
Author: Sebb <[email protected]>
AuthorDate: Sat Feb 15 17:22:46 2025 +0000
Ensure mtime is set, and can be read
---
www/status/index.cgi | 2 +-
www/status/monitor.rb | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/www/status/index.cgi b/www/status/index.cgi
index 4b68bd03..8f477234 100755
--- a/www/status/index.cgi
+++ b/www/status/index.cgi
@@ -7,7 +7,7 @@ require 'whimsy/asf/status'
json = File.expand_path('../status.json', __FILE__)
begin
- status = JSON.parse(File.read(json, encoding: Encoding::UTF_8))
+ status = JSON.parse(File.read(json, encoding: Encoding::UTF_8),
{symbolize_names: true})
rescue Exception => e
$stderr.puts "index.cgi: Failed to read status.json: #{e}"
status = {}
diff --git a/www/status/monitor.rb b/www/status/monitor.rb
index f90fcb2e..86637f21 100644
--- a/www/status/monitor.rb
+++ b/www/status/monitor.rb
@@ -114,7 +114,9 @@ class StatusMonitor
timings << Time.now
# normalize status
- @status = normalize(data: newstatus)
+ status = normalize(data: newstatus)
+ status[:mtime] = Time.now.gmtime.iso8601
+ @status = status
timings << Time.now
File.write(File.expand_path('../../logs/status.data', __FILE__),