Skip to content

Commit

Permalink
Merge pull request #71 from candlepin/ptoscano/lastupload-file
Browse files Browse the repository at this point in the history
feat: switch from .last-upload.results to .lastupload
  • Loading branch information
jirihnidek authored Aug 5, 2024
2 parents 4e563db + 2ac616f commit 9b35f44
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/insights.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,15 @@ function jump_to_timer() {
function monitor_last_upload() {
let self = {
timestamp: 0,
results: null,

close: close
};

cockpit.event_target(self);

let results_file = cockpit.file("/etc/insights-client/.last-upload.results", { syntax: JSON });
results_file.watch(data => {
self.results = data;
cockpit.spawn([ "stat", "-c", "%Y", "/etc/insights-client/.last-upload.results" ], { err: "message" })
let results_file = cockpit.file("/etc/insights-client/.lastupload");
results_file.watch(() => {
cockpit.spawn([ "stat", "-c", "%Y", "/etc/insights-client/.lastupload" ], { err: "message" })
.then(ts => {
self.timestamp = parseInt(ts);
self.dispatchEvent("changed");
Expand All @@ -388,7 +386,7 @@ function monitor_last_upload() {
self.timestamp = 0;
self.dispatchEvent("changed");
});
});
}, { read: false });

function close() {
results_file.close();
Expand Down

0 comments on commit 9b35f44

Please sign in to comment.