Add two-stage run verification and 24-hour Activity filter
All checks were successful
Deploy / deploy (push) Successful in 57s
All checks were successful
Deploy / deploy (push) Successful in 57s
Status now reads "Sent" when the confirmation click lands, since that only means MassPrice accepted the run request, not that it finished — their own processing is async and takes anywhere from ~1 to ~22 minutes in observed practice. A new "Complete" column tracks that separately: run_rule() captures a watermark (the target rule's current top data-activitylogid on /Activity/List, not the displayed timestamp string, to sidestep fragile date/timezone parsing) before submitting, and scheduler.py schedules a one-off verify_run() job VERIFY_DELAY_MINUTES later to check whether a new "Complete" entry appeared past that watermark. rebuild_jobs() now only clears recurring "rule-*" jobs, not the one-off "verify-*" jobs, so editing a schedule can't cancel a verification that's already in flight for an earlier run. Also scopes the Activity page to the last 24 hours per request. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H6TgffxTvYhqxykAbVQg2v
This commit is contained in:
parent
988db5d5c4
commit
8b58dadc5a
8 changed files with 249 additions and 20 deletions
|
|
@ -2,20 +2,35 @@
|
|||
{% block title %}Activity · MassPrice Scheduler{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Activity</h1>
|
||||
<p class="muted small">Showing the last 24 hours.</p>
|
||||
{% if not history %}
|
||||
<p class="empty-state">No runs recorded yet.</p>
|
||||
<p class="empty-state">No runs recorded in the last 24 hours.</p>
|
||||
{% else %}
|
||||
<table class="activity-table">
|
||||
<thead>
|
||||
<tr><th>Time</th><th>Rule</th><th>Status</th><th>Message</th></tr>
|
||||
<tr><th>Time</th><th>Rule</th><th>Status</th><th>Complete</th><th>Message</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in history %}
|
||||
<tr class="status-row-{{ entry.status }}">
|
||||
<td>{{ entry.timestamp }}</td>
|
||||
<td>{{ entry.rule_name or entry.rule_id }}</td>
|
||||
<td><span class="status-dot status-{{ entry.status }}"></span>{{ entry.status }}</td>
|
||||
<td class="muted">{{ entry.message }}</td>
|
||||
<td><span class="status-dot status-{{ entry.status }}"></span>{{ entry.status | capitalize }}</td>
|
||||
<td>
|
||||
{% if entry.verification == 'complete' %}
|
||||
<span class="status-dot status-complete"></span>Complete
|
||||
{% elif entry.verification == 'pending' %}
|
||||
<span class="status-dot status-pending"></span>Pending
|
||||
{% elif entry.verification == 'not_confirmed' %}
|
||||
<span class="status-dot status-not-confirmed"></span>Not Confirmed
|
||||
{% else %}
|
||||
<span class="muted">—</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="muted">
|
||||
{{ entry.message }}
|
||||
{% if entry.verify_message %}<div class="small">{{ entry.verify_message }}</div>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue