Skip to main content

record_github_contact

Function record_github_contact 

Source
pub fn record_github_contact(
    paths: &AppPaths,
    at: DateTime<Utc>,
) -> Result<(), ServiceError>
Expand description

Records that GitHub was reached successfully, for service status to report.

§The contract, for f3 and for the agent

Journey 5 step 4 requires service status to report “the last successful GitHub contact”, and service status runs in the operator’s terminal while the daemon runs in a service. They share no memory, so the fact has to be on disk, and this is the file. The daemon calls this after each successful GitHub call; nothing else writes it.

It is a single timestamp and deliberately not a log: an operator asking this question wants to know whether the agent is alive and reaching GitHub now, and a value that is minutes old answers it. Writing it is a whole-file replace through a temporary in the same directory, so a status command can never read a half-written timestamp.

§Errors

ServiceError::Record when state/ cannot be written.