+
    jHàj}  ã                   ó~   € R t ^ RIHtHtHtHt ^ RIt]P                  ! ]4      tR t	R t
R tR tR R ltR	 R
 ltR# )zŒExact scheduled identities, independent of mutable jobs.json dispatch stamps, plus the
profile-local stale-schedule catch-up counter marker.)ÚdatetimeÚ	timedeltaÚtimezoneÚUTCNc                óê   € \        V \        4      '       g   R#  \        P                  ! V 4      pVP                  f   R# VP                  \        4      P                  4       #   \         d     R# i ; i)zMCanonicalize aware instants; legacy/ambiguous values carry no exact identity.N)	Ú
isinstanceÚstrr   ÚfromisoformatÚtzinfoÚ
astimezoner   Ú	isoformatÚ
ValueError)ÚvalueÚinstants   & Ú5/home/ubuntu/.hermes/hermes-agent/cron/occurrences.pyÚscheduled_instantr   	   s`   € ä�eœS×!Ò!ÙðÜ×(Ò(¨Ó/ˆØ�>‰>Ò!ÙØ×!Ñ!¤#Ó&×0Ñ0Ó2Ð2øÜô Úðús   š$A# Á "A# Á#A2Á1A2c           
     ó  € ^ RI Hp ^ RIHp \	        V4      pVf   R# \
        P                  ! V4      \        VR7      ,
          p V! 4       ;_uu_ 4       pVP                  R\        V R,          4      V34      P                  4       pRRR4       X F®  p\	        VR,          ;'       g
    VR	,          4      pVe   \
        P                  ! V4      V8¼  g   KG  \        P                  R
V P                  RV P                  R4      4      V P                  R4      YR,          VR,          ;'       g
    VR	,          4        R# 	  R#   + '       g   i     LÆ; i  \         d$    \        P                  RT R,          RR7        R# i ; i)zKUnknown/failed/pruned attempts cannot prove completion: keep them eligible.)ÚFIRE_CLAIM_SKEW_SECONDS)Ú_transactionNF)ÚsecondszpSELECT id, finished_at, claimed_at FROM executions WHERE job_id=? AND scheduled_instant=? AND status='completed'ÚidÚfinished_atÚ
claimed_atzƒJob '%s' (%s): scheduled occurrence %s was already completed by execution %s (finished %s); skipping the due slot without a new runÚnameTz,Cannot check completed occurrence for job %s)Úexc_info)Úcron.constantsr   Úcron.executionsr   r   r   r	   r   Úexecuter   ÚfetchallÚloggerÚwarningÚgetÚ	Exception)	Újobr   r   r   Úearliest_realÚconnÚrowsÚrowÚcompleted_ats	   &&       r   Úcompleted_occurrencer)      sF  € å6Ý,ä Ó(€GØ‚Ùä×*Ò*¨7Ó3´iÐH_Ô6`Õ`€MðÙ�^Œ^˜tØ—<‘<ð)ä+.¨s°4­y«>¸7Ð*Có÷ ‰h‹jð	 ÷ ó ˆCÜ,¨S°Õ-?×-TÐ-TÀ3À|ÕCTÓUˆLð Ò#¤x×'=Ò'=¸lÓ'KÈ}Ö'\ô —‘ðPà—G‘G˜F C§G¡G¨D£MÓ2°C·G±G¸D³MÀ7ÐPTÍIØ˜Õ&×;Ð;¨#¨lÕ*;ô	=ò
 ñ ñ ÷' �^ûô( ô Ü�‰ÐEÀsÈ4ÅyÐ[_ˆÔ`ÚðúsC   ÁE Á3EÂ!E Â**E ÃAE Ä1E ÅE ÅE	ÅE Å*FÆFc                óD   € ^ RI Hp RV RVP                  4       RV! 4       /# )zLStore value for a recurring occurrence about to be handed to the dispatcher.)Ú_machine_idÚscheduled_atÚatÚby)Ú	cron.jobsr+   r   )Únext_runÚnowr+   s   && r   Úpending_slot_stampr2   G   s    € å%à˜H d¨C¯M©M«O¸TÁ;Ã=ÐQÐQó    c                ó  € ^ RI Hp ^ RIHpHpHp V P                  R4      p\        V\        4      '       g   R# VP                  R4      pV P                  R/ 4      P                  R4      R9  g   \        V\        4      '       g   R#  \        P                  ! V4       T! \        T P                  RR	4      4      4      '       d   R# TP                  R
4      T! 4       8w  d   T! YaT4      '       d   R# T#   \         d     R# i ; i)uì  Stored instant of a slot the dispatcher never claimed, or None.

None for non-recurring jobs and malformed stamps (never a fire) and for a job still in this
process's running set (its queued worker will claim and clear the slot itself). A stamp by
THIS process on a job not running here is orphaned (dispatch refused). A stamp by another
process is honoured while that owner may still be alive within the fire-claim lease â€” a
second live gateway on the same store is mid-dispatch, not dead.)ÚFIRE_CLAIM_TTL_SECONDS)Ú_claim_is_liveÚ_job_running_in_this_processr+   Úpending_slotNr,   ÚscheduleÚkindr   Ú r.   >   ÚcronÚinterval)r   r5   r/   r6   r7   r+   r!   r   Údictr   r   r	   r   )r#   r1   r5   r6   r7   r+   ÚpendingÚslots   &&      r   Úunclaimed_pending_slotrA   N   sØ   € õ 6ßSÑSà�g‰g�nÓ%€GÜ�gœt×$Ò$ÙØ�;‰;�~Ó&€DØ
‡w�wˆz˜2Ó×"Ñ" 6Ó*Ð2FÔFÌjÐY]Ô_b×NcÒNcÙðÜ×Ò˜tÔ$ñ $¤C¨¯©°°bÓ(9Ó$:×;Ò;ÙØ‡{�{�4Ó™K›MÔ)©n¸WÐKa×.bÒ.bÙØ€Køô ô Úðús   Â
C7 Ã7DÄDc                ó$   € V ^8„  d   QhR\         /# )é   Úreturn)Úint)Úformats   "r   Ú__annotate__rG   j   s   € ÷ ñ ¤sñ r3   c            	     óÖ   € ^ RI Hp  V ! 4       P                  R,          p \        ^ \	        VP                  RR7      P                  4       4      4      #   \        \        3 d     ^ # i ; i)z7Return the profile-local stale-schedule catch-up count.)Ú_current_cron_storeÚcatch_up_occurrencesz	utf-8-sig)Úencoding)	r/   rI   Úcron_dirÚmaxrE   Ú	read_textÚstripÚOSErrorr   )rI   Úpaths     r   Úget_catch_up_occurrence_countrR   j   s[   € å-áÓ ×)Ñ)Ð,BÕB€DðÜ�1”c˜$Ÿ.™.°+˜.Ó>×DÑDÓFÓGÓHÐHøÜ”ZÐ ô Úðús    2A ÁA(Á'A(c                ó   € V ^8„  d   QhRR/# )rC   rD   N© )rF   s   "r   rG   rG   u   s   € ÷ _ñ _ Dñ _r3   c                 óV   € ^ RI Hp  V ! R\        \        4       ^,           4      R4       R# )zIIncrement the profile-local stale-schedule catch-up counter, best effort.©Ú_write_markerrJ   z.count_N)r/   rW   r   rR   rV   s    r   Úrecord_catch_up_occurrencerX   u   s"   € å'áÐ(¬#Ô.KÓ.MÐPQÕ.QÓ*RÐT]Ö^r3   )Ú__doc__r   r   r   r   ÚloggingÚ	getLoggerÚ__name__r   r   r)   r2   rA   rR   rX   rT   r3   r   Ú<module>r]      sD   ðñ9ç 7Ó 7Û à	×	Ò	˜8Ó	$€ò
ò!òbRòõ8÷_r3   