#!/bin/bash

# 当前时间
current_time=$(date -u +%s)

# 任务更新时间: 2026-05-24T06:13:15Z
updated_at="2026-05-24T06:13:15Z"
updated_timestamp=$(date -d "$updated_at" +%s)

# 计算时间差（秒）
time_diff=$((current_time - updated_timestamp))

# 转换为小时
hours_diff=$((time_diff / 3600))

echo "当前时间: $(date -u)"
echo "任务更新时间: $updated_at"
echo "时间差: ${hours_diff} 小时 ($time_diff 秒)"

# 检查是否超过2小时
if [ $time_diff -gt 7200 ]; then
    echo "状态: ⚠️ 超过2小时未更新"
    exit 0
else
    echo "状态: ✅ 2小时内有更新"
    exit 1
fi
