(self, topup)
return max(10, min((ORG_CREDITS_CACHE_TTL, int((topup.expires_on - timezone.now()).total_seconds()))))
Gets how long metrics based on the given topup should live. Returns the shorter ttl of
        either ORG_CREDITS_CACHE_TTL or time remaining on the expiration
Gets how long metrics based on the given topup should live. Returns the shorter ttl of
        either ORG_CREDITS_CACHE_TTL or time remaining on the expiration
Gets how long metrics based on the given topup should live . Returns the shorter ttl of either ORG_CREDITS_CACHE_TTL or time remaining on the expiration
def get_topup_ttl(self, topup):
        """
        Gets how long metrics based on the given topup should live. Returns the shorter ttl of
        either ORG_CREDITS_CACHE_TTL or time remaining on the expiration
        """
        if not topup:
            return 10

        return max(10, min((ORG_CREDITS_CACHE_TTL, int((topup.expires_on - timezone.now()).total_seconds()))))
def get_topup_ttl ( self , topup ) : if not topup : return 10 return max ( 10 , min ( ( ORG_CREDITS_CACHE_TTL , int ( ( topup . expires_on - timezone . now ( ) ) . total_seconds ( ) ) ) ) )