scx_truther 0.6.2

A useless scheduler for sched-ext (rustland-core) that dispenses astrology, conspiracy theories, numerology, and cryptid sightings instead of scheduling anything
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2.

use log::info;
use std::time::{SystemTime, UNIX_EPOCH};

/// Mercury is retrograde exactly as often as your last three deploys failed
/// for reasons you couldn't explain: roughly one day in five, computed from
/// today's date so it's at least consistent within a day. Astronomically
/// nonsense. Emotionally accurate.
#[must_use]
pub fn is_retrograde() -> bool {
    let days = SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .map_or(0, |d| d.as_secs() / 86_400);

    days.is_multiple_of(5)
}

pub fn log() {
    if is_retrograde() {
        info!("Mercury is retrograde. This explains your last three deploys.");
    } else {
        info!("Mercury is not retrograde. You have no excuse today.");
    }
}