e-note-ion 2.1.1__tar.gz → 2.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {e_note_ion-2.1.1/e_note_ion.egg-info → e_note_ion-2.1.2}/PKG-INFO +1 -1
  2. {e_note_ion-2.1.1 → e_note_ion-2.1.2/e_note_ion.egg-info}/PKG-INFO +1 -1
  3. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/health.py +30 -1
  4. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/pyproject.toml +1 -1
  5. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/scheduler.py +8 -0
  6. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/LICENSE.txt +0 -0
  7. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/MANIFEST.in +0 -0
  8. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/README.md +0 -0
  9. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/config.py +0 -0
  10. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/e_note_ion.egg-info/SOURCES.txt +0 -0
  11. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/e_note_ion.egg-info/dependency_links.txt +0 -0
  12. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/e_note_ion.egg-info/entry_points.txt +0 -0
  13. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/e_note_ion.egg-info/requires.txt +0 -0
  14. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/e_note_ion.egg-info/top_level.txt +0 -0
  15. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/exceptions.py +0 -0
  16. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/healthalert.py +0 -0
  17. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/homebridge.py +0 -0
  18. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/__init__.py +0 -0
  19. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/bart.py +0 -0
  20. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/calendar.py +0 -0
  21. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/calendar_schedule.py +0 -0
  22. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/color.py +0 -0
  23. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/discogs.py +0 -0
  24. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/diving.py +0 -0
  25. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/google.py +0 -0
  26. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/http.py +0 -0
  27. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/media.py +0 -0
  28. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/message.py +0 -0
  29. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/moon.py +0 -0
  30. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/morning.py +0 -0
  31. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/notion.py +0 -0
  32. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/parcel.py +0 -0
  33. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/plex.py +0 -0
  34. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/qbittorrent.py +0 -0
  35. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/scheduler.py +0 -0
  36. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/tmdb.py +0 -0
  37. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/trakt.py +0 -0
  38. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/unraid.py +0 -0
  39. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/uptimerobot.py +0 -0
  40. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/vestaboard.py +0 -0
  41. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/weather.py +0 -0
  42. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/ynab.py +0 -0
  43. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/integrations/youtube.py +0 -0
  44. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/public.py +0 -0
  45. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/quiet.py +0 -0
  46. {e_note_ion-2.1.1 → e_note_ion-2.1.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: e-note-ion
3
- Version: 2.1.1
3
+ Version: 2.1.2
4
4
  Summary: Automation for Vestaboard displays — with emotion
5
5
  Author-email: Jason Puglisi <jason@pugli.si>
6
6
  Maintainer-email: Jason Puglisi <jason@pugli.si>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: e-note-ion
3
- Version: 2.1.1
3
+ Version: 2.1.2
4
4
  Summary: Automation for Vestaboard displays — with emotion
5
5
  Author-email: Jason Puglisi <jason@pugli.si>
6
6
  Maintainer-email: Jason Puglisi <jason@pugli.si>
@@ -103,6 +103,9 @@ class _TargetState:
103
103
  # webhook-only targets, which fire on external events with no predictable
104
104
  # interval and are therefore never overdue.
105
105
  expected_interval: float | None = None
106
+ # When this integration was last *scheduled*, which is not the same as when it
107
+ # last produced an event — see note_scheduled().
108
+ last_scheduled: float = 0.0
106
109
 
107
110
 
108
111
  # Reserved target name for the Vestaboard send path. Registered implicitly
@@ -284,6 +287,30 @@ def set_expected_interval(name: str, seconds: float) -> None:
284
287
  state.expected_interval = seconds
285
288
 
286
289
 
290
+ def note_scheduled(name: str) -> None:
291
+ """Record that *name* was enqueued, whatever becomes of the message.
292
+
293
+ Overdue detection asks "has this integration stopped firing". Health events
294
+ cannot answer that on their own, because an event is only recorded once the
295
+ worker pops the message and calls the integration — and a message that loses
296
+ priority contention is discarded before that ever happens.
297
+
298
+ A Plex now-playing card holds the board indefinitely, so during a film
299
+ contrib.uptimerobot.status is enqueued every 5 minutes and discarded 2
300
+ minutes later, never reaching the integration. Nothing is wrong: #600 already
301
+ classifies exactly that discard as expected. Without this, overdue flagged it
302
+ anyway and /health went red for the length of the film.
303
+
304
+ Deliberately not a HealthEvent: this says the scheduler fired, not that the
305
+ integration succeeded, and folding it into the event deque would corrupt the
306
+ success-rate calculation.
307
+ """
308
+ with _lock:
309
+ state = _targets.get(name)
310
+ if state is not None:
311
+ state.last_scheduled = time.time()
312
+
313
+
287
314
  def _is_overdue(state: _TargetState, now: float) -> bool:
288
315
  """Return True if *state* has gone too long without firing. Caller holds _lock."""
289
316
  if state.expected_interval is None:
@@ -299,7 +326,9 @@ def _is_overdue(state: _TargetState, now: float) -> bool:
299
326
  # timestamp, and register() leaves an existing target alone. So a restored
300
327
  # target carries an old registered_at too.
301
328
  last = state.events[-1].timestamp if state.events else state.registered_at
302
- reference = max(last, _started_at)
329
+ # Being scheduled counts as alive even when the message never reached the
330
+ # integration, so a long hold on the board cannot look like a stalled cron.
331
+ reference = max(last, _started_at, state.last_scheduled)
303
332
  return (now - reference) > state.expected_interval * _OVERDUE_INTERVAL_MULTIPLIER
304
333
 
305
334
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "e-note-ion"
3
- version = "2.1.1"
3
+ version = "2.1.2"
4
4
  description = "Automation for Vestaboard displays — with emotion"
5
5
  keywords = ["vestaboard", "note", "flagship", "automation", "schedule", "scheduling"]
6
6
  authors = [
@@ -201,6 +201,14 @@ def enqueue(
201
201
  seq = _counter
202
202
  _counter += 1
203
203
 
204
+ # An enqueue means the cron fired, which is what overdue detection actually
205
+ # cares about. Recorded here rather than at send time because a message that
206
+ # loses priority contention is discarded before the integration is ever
207
+ # called — see health.note_scheduled(). (#502)
208
+ integration = data.get('integration')
209
+ if integration:
210
+ _health_mod.note_scheduled(integration)
211
+
204
212
  msg = QueuedMessage(
205
213
  priority=priority,
206
214
  seq=seq,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes