+
    jHàjÐ  ã                  ó’   € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	 ]P                  ! ]4      tRtR R ltR R	 ltR
 R ltR# )a¡  Home-channel notices for cron store degraded-state transitions (see ``cron/store_health.py``).

The cron tick runs on a worker thread inside the gateway. When a profile's cron store becomes
unwritable it reports ONE transition, and again when it recovers. Each one is posted to that
profile's home channels, honouring that profile's warning-notification opt-out, through the same
send path the state.db warning uses.
)ÚannotationsN)ÚPath)Útg      ¬@c               ó    € V ^8„  d   QhRRRR/# )é   Úloopzasyncio.AbstractEventLoopÚreturnÚNone© )Úformats   "Ú?/home/ubuntu/.hermes/hermes-agent/gateway/cron_store_notices.pyÚ__annotate__r      s   € ÷ 5,ñ 5,Ð-Fð 5,È4ñ 5,ó    c                óú   a aaaaa	a
aaa€ ^ RI HoHpHp \	        4       o/ o
/ oR VVV
V V3R lloR VV3R lloR VV
V3R lloR VVV
VV3R	 llo	R
 VV	3R llpV! V4       V! 4        F  pV! RV4       K  	  R# )zóRoute store transitions from the ticker thread onto the gateway loop. Installed once the
adapters are connected, so a store that degraded during boot is announced then. The last
notice a home channel sees always matches the store's real state.)Údegraded_recordÚdegraded_recordsÚset_transition_listenerc               ó   € V ^8„  d   QhRR/# ©r   r   r	   r
   )r   s   "r   r   Ú0install_cron_store_notices.<locals>.__annotate__$   s   € ÷ @ñ @¨ñ @r   c              “  óØ  <"  € SP                  VP                  \        P                  ! 4       4      ;_uu_4       GR j  x€L
  S! \	        VP                  4      4      R JpV R8X  dg   V'       g_   SP                  VP                  4       SP                  VP                  R 4      ;pe   VP                  4         R R R 4      GR j  x€L
  R # V R8X  dH   V'       g   VP                  S9  d    R R R 4      GR j  x€L
  R # SP                  VP                  4       \        SW4      G R j  x€L
  R R R 4      GR j  x€L
  R #  EL L} LL L L  + GR j  x€L 
 '       g   i     R # ; i5i)NÚ
unwritableÚ	recovered)	Ú
setdefaultÚstoreÚasyncioÚLockr   ÚdiscardÚpopÚcancelÚsend_cron_store_notice)	ÚeventÚrecordÚdegradedÚhandleÚ	announcedr   ÚpendingÚrunnerÚsendings	   &&  €€€€€r   ÚdeliverÚ+install_cron_store_notices.<locals>.deliver$   sý   øé € Ø×%Ñ% f§l¡l´G·L²L³N×C×CÕCñ '¤t¨F¯L©LÓ'9Ó:À$ÐFˆHØ˜Ô$¯XØ×!Ñ! &§,¡,Ô/Ø%Ÿk™k¨&¯,©,¸Ó=Ð=�FÒJØ—M‘M”OØ÷ D×CÑCð ˜Ô#ß˜vŸ|™|°9Ô<Ø÷ D×CÑCð ×!Ñ! &§,¡,Ô/Ü(¨°Ó?×?Ð?÷ D×C×CÐCñ @÷ D×C×CÓCüs§   ƒ<E*¿EÁ E*Á,EÁ0AEÂ<E*ÃEÃE*ÃEÃEÃ/E*Ã:EÃ;E*Ä*EÄ+E	Ä,EÄ0E*Ä;EÄ<E*ÅE*ÅE*Å	EÅE*ÅE'	ÅEÅ
E'	ÅE'	Å!	E*c               ó   € V ^8„  d   QhRR/# r   r
   )r   s   "r   r   r   4   s   € ÷ \ñ \˜tñ \r   c                óh   <a a€ SP                  S! S S4      4      pVP                  V V3R  l4       R# )c                ó2   <€ \        V SSP                  4      # ©N)Ú_log_notice_failurer   )Údoner!   r"   s   &€€r   Ú<lambda>Ú:install_cron_store_notices.<locals>.send.<locals>.<lambda>6   s   ø€ Ô,?ÀÀeÈVÏ\É\Ô,Zr   N)Úcreate_taskÚadd_done_callback)r!   r"   Útaskr)   r   s   ff €€r   ÚsendÚ(install_cron_store_notices.<locals>.send4   s)   ú€ Ø×Ñ¡¨¨vÓ 6Ó7ˆØ×ÑÕZÖ[r   c               ó   € V ^8„  d   QhRR/# r   r
   )r   s   "r   r   r   8   s   € ÷ &ñ & $ñ &r   c                óx   <€ SP                  V P                  R 4       V P                  S9   d   S! RV 4       R # R # )Nr   )r   r   )r"   r%   r&   r6   s   &€€€r   Úsend_recoveredÚ2install_cron_store_notices.<locals>.send_recovered8   s0   ø€ Ø�‰�F—L‘L $Ô'Ø�<‰<˜9Ô$Ù�˜fÖ%ñ %r   c               ó   € V ^8„  d   QhRR/# r   r
   )r   s   "r   r   r   =   s   € ÷ 	\ñ 	\ $ñ 	\r   c                ó  <€ VP                   pV R 8X  dM   SP                  VR4      ;pe   VP                  4        R# VS9  d   SP                  V4       S! W4       R# R# VS9   d&   VS9  d   SP	                  \
        SV4      SV&   R# R# R# )r   N)r   r   r   ÚaddÚ
call_laterÚNOTICE_REPEAT_SECONDS)	r!   r"   r   r$   r%   r   r&   r6   r:   s	   &&  €€€€€r   Úon_loopÚ+install_cron_store_notices.<locals>.on_loop=   s…   ø€ Ø—‘ˆØ�LÔ Ø!Ÿ+™+ e¨TÓ2Ð2�Ò?Ø—‘–Ø˜iÔ'Ø—‘˜eÔ$Ù�UÖ#ñ (ð �iÔ E°Ô$8Ø!Ÿ_™_Ô-BÀNÐTZÓ[ˆG�E‹Nñ %9Ñr   c               ó   € V ^8„  d   QhRR/# r   r
   )r   s   "r   r   r   H   s   € ÷ :ñ :¨ñ :r   c                ó,   <€ SP                  SW4       R # r.   )Úcall_soon_threadsafe)r!   r"   r   rA   s   &&€€r   Úon_transitionÚ1install_cron_store_notices.<locals>.on_transitionH   s   ø€ à×!Ñ! '¨5Ö9r   r   N)Úcron.store_healthr   r   r   Úset)r'   r   r   r   rF   r"   r%   r   r)   rA   r&   r6   r:   r(   s   ff    @@@@@@@@r   Úinstall_cron_store_noticesrJ      sy   ÿù€ ÷ ]Ñ\ô ›%€IØ.0€GØ')€G÷@ô @÷ \ñ \÷&ò &÷
	\ô 	\÷:ñ :ñ ˜MÔ*Ù"Ö$ˆÙ�l FÖ+ó %r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r!   Ústrr   r   r	   r
   )r   s   "r   r   r   Q   s&   € ÷ Zñ Z Sð Z°ð Z¸ñ Zr   c                óª   €  V P                  4        R #   \        P                   d     R # \         d    \        P                  RYRR7        R # i ; i)Nz"Cron store %s notice for %s failedT)Úexc_info)Úresultr   ÚCancelledErrorÚ	ExceptionÚloggerÚwarning)r0   r!   r   s   &&&r   r/   r/   Q   sG   € ðZØ�‰ŽøÜ×!Ñ!ô ÚÜô ZÜ�‰Ð;¸UÐTXˆ×YðZús   ‚ ”A¬AµAÁAc               ó    € V ^8„  d   QhRRRR/# )r   r!   rL   r   r	   r
   )r   s   "r   r   r   Z   s   € ÷ #ñ #°ð #Àñ #r   c           
   ƒ  óè  a aaaa"  € ^ RI Hp ^ RIHp ^ RIHp ^ RIHp VP                  4       pVR8X  d   RMRpS P                  ;'       g    / p	\        P                  RWP                  4       \        S P                  4       4       F¿  w  p
opooV
e   V	P                  V
4      MR	pT! T;'       g    V! 4       4      VP                  8w  d   KH  V'       d   V! \!        V4      4      M\"        P$                  ! 4       pT;_uu_4       GR	j  x€L
  \'        V3/ VB oV! VVVV V3R
 lSR7      G R	j  x€L
  R	R	R	4      GR	j  x€L
  KÁ  	  R	#  L@ L L  + GR	j  x€L 
 '       g   i     Kå  ; i5i)zYPost one ``unwritable``/``recovered`` notice to the home channels of the store's profile.)Ú_async_profile_runtime_scope)Úpresent_notification)Ú	store_key)Úget_routing_process_hermes_homer   zgateway.cron_store.unwritablezgateway.cron_store.recoveredz(Broadcasting cron store %s notice for %sNc                 ó.   <€ SP                  SS SSR 4      # )z&Cron store notice failed for %s:%s: %s)Ú_send_home_channel_message)ÚhomeÚmessageÚplatformr'   Ú	transports   €€€€€r   r1   Ú(send_cron_store_notice.<locals>.<lambda>o   s   ø€ ˜×9Ñ9Ø˜d I¨wÐ8`ôbr   )r^   )Úgateway.runrV   Úgateway.warning_notificationsrW   rH   rX   Úhermes_constantsrY   Únotice_fieldsÚ_served_profile_homesrR   Úinfor   ÚlistÚ_served_home_channel_transportsÚgetr   Ú
contextlibÚnullcontextr   )r'   r!   r"   rV   rW   rX   rY   ÚfieldsÚkeyÚserved_homesÚprofileÚ_cfgÚserved_homeÚscoper\   r]   r^   r_   s   f&&           @@@@r   r    r    Z   s$  üé € å8ÝBÝ+Ý@à×!Ñ!Ó#€FØ-2°lÔ-BÑ
)ÐHf€CØ×/Ñ/×5Ð5°2€LÜ
‡K�KÐ:¸EÇ<Á<ÔPÜ48¸×9_Ñ9_Ó9aÖ4bÑ0ˆ�˜4  yØ3:Ò3F�l×&Ñ& wÔ/ÈDˆá�[×EÐEÑ$CÓ$EÓFÈ&Ï,É,ÔVÙçCNÑ,¬T°+Ó->Ô?ÔT^×TjÒTjÓTlˆß—5’5Ü˜Ñ&˜vÑ&ˆGÙ&÷bð bà!ô#÷ #ð #÷ —5‘5ó 5cñ ñ#÷ —5—5“5üss   ‡AE2ÁA&E2Â5$E2Ã4E2ÄE
ÄE2Ä"EÄ4E
Ä5EÄ9E2ÅEÅE2ÅEÅE2ÅE/ÅEÅ
E/Å'E/Å)	E2)Ú__doc__Ú
__future__r   r   rj   ÚloggingÚpathlibr   Ú
agent.i18nr   Ú	getLoggerÚ__name__rR   r@   rJ   r/   r    r
   r   r   Ú<module>rz      sG   ðñõ #ã Û Û Ý å à	×	Ò	˜8Ó	$€ð Ð õ5,õpZ÷#r   