
    P1i&                     2    d dl mZ d dlmZ  G d de      Zy)    )cache)BaseCommandc                       e Zd ZdZd Zd Zy)Commandz|Bumps the version for BaZi good-days cache so old entries are ignored. Optionally purge a previous version with --purge VER.c                 4    |j                  dt        d       y )Nz--purgezOptional: previous version number to purge from cache (requires Redis with SCAN/UNLINK support and a custom purge implementation).)typehelp)add_argumentint)selfparsers     U/home/cursorai/projects/iching/main/management/commands/clear_bazi_good_days_cache.pyadd_argumentszCommand.add_arguments   s!     V 	 	
    c                 t   t        j                  dd      }|dz   }t        j                  d|d        | j                  j	                  | j
                  j                  d| d|              |j                  d      }|9| j                  j	                  | j
                  j                  d| d             y y )Nbz_good_days_version   zbz_good_days_version bumped: z -> purgezPurge requested for version z-. Implement backend-specific purge if needed.)r   getsetstdoutwritestyleSUCCESSWARNING)r   argsoptionscurrentnew_version	purge_vers         r   handlezCommand.handle   s    ))2A6k		(+t<$**,,/LWIUYZeYf-ghiKK(	  KK

""29+=jk !r   N)__name__
__module____qualname__r	   r   r!    r   r   r   r      s     JD
r   r   N)django.core.cacher   django.core.management.baser   r   r%   r   r   <module>r(      s    # 3k r   