
    @OOf)                    D    d dl mZ d dlZd dlmZ d dlmZ  G d d      Zy)    )annotationsN)ctx)asyncio_utilsc                  <    e Zd ZU dZded<   d Zd	dZd Zd Zd Z	y)
KeepServingNzasyncio.Task | None_watch_taskc                4    |j                  dt        dd       y )NkeepservingFz
            Continue serving after client playback, server playback or file
            read. This option is ignored by interactive tools, which always keep
            serving.
            )
add_optionbool)selfloaders     ]/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/mitmproxy/addons/keepserving.pyloadzKeepServing.load   s    			
    c                    g d}t        |D cg c]+  }t        j                  j                  j	                  |      - c}      S c c}w )N)zreadfile.readingzreplay.client.countzreplay.server.count)anyr   mastercommandscall)r   checkscs      r   	keepgoingzKeepServing.keepgoing   s9    

 @ACJJ'',,Q/@AA@s   0Ac                @    t         j                  j                          y )N)r   r   shutdownr   s    r   r   zKeepServing.shutdown    s    

r   c                   K   	 t        j                  d       d {    | j                         s| j                          >7 %w)Ng?)asynciosleepr   r   r   s    r   watchzKeepServing.watch#   s6     --$$$>># $s   AA&Ac                @   t         j                  j                  t         j                  j                  t         j                  j                  g}t        |      rFt         j                  j                  s+t        j                  | j                         d      | _
        y y y )Nr
   )name)r   optionsclient_replayserver_replayrfiler   r
   r   create_taskr    r   )r   optss     r   runningzKeepServing.running)   sj    KK%%KK%%KK

 t9S[[44,88

= D 59r   )returnr   )
__name__
__module____qualname__r   __annotations__r   r   r   r    r)    r   r   r   r   	   s'    '+K$+

B 	r   r   )
__future__r   r   	mitmproxyr   mitmproxy.utilsr   r   r/   r   r   <module>r3      s    "   )) )r   