data/model/oci/tag.py
def _delete_tag(tag, now_ms):
    """
    Deletes the given tag by marking it as expired.
    """
    now_ts = int(now_ms / 1000)

    with db_transaction():
        updated = (
            Tag.update(lifetime_end_ms=now_ms)
            .where(Tag.id == tag.id, Tag.lifetime_end_ms == tag.lifetime_end_ms)
            .execute()
        )
        if updated != 1:
            return None

        # TODO: Remove the linkage code once RepositoryTag is gone.
        try:
            old_style_tag = (
                TagToRepositoryTag.select(TagToRepositoryTag, RepositoryTag)
                .join(RepositoryTag)
                .where(TagToRepositoryTag.tag == tag)
                .get()
            ).repository_tag

            old_style_tag.lifetime_end_ts = now_ts
            old_style_tag.save()
        except TagToRepositoryTag.DoesNotExist:
            pass

        return tag

    Deletes the given tag by marking it as expired.
    
Deletes the given tag by marking it as expired.
Deletes the given tag by marking it as expired .
def _delete_tag(tag, now_ms):
    now_ts = int(now_ms / 1000)
    with db_transaction():
        updated = (
            Tag.update(lifetime_end_ms=now_ms)
            .where(Tag.id == tag.id, Tag.lifetime_end_ms == tag.lifetime_end_ms)
            .execute()
        )
        if updated != 1:
            return None
        try:
            old_style_tag = (
                TagToRepositoryTag.select(TagToRepositoryTag, RepositoryTag)
                .join(RepositoryTag)
                .where(TagToRepositoryTag.tag == tag)
                .get()
            ).repository_tag
            old_style_tag.lifetime_end_ts = now_ts
            old_style_tag.save()
        except TagToRepositoryTag.DoesNotExist:
            pass
        return tag
def _delete_tag ( tag , now_ms ) : now_ts = int ( now_ms / 1000 ) with db_transaction ( ) : updated = ( Tag . update ( lifetime_end_ms = now_ms ) . where ( Tag . id == tag . id , Tag . lifetime_end_ms == tag . lifetime_end_ms ) . execute ( ) ) if updated != 1 : return None try : old_style_tag = ( TagToRepositoryTag . select ( TagToRepositoryTag , RepositoryTag ) . join ( RepositoryTag ) . where ( TagToRepositoryTag . tag == tag ) . get ( ) ) . repository_tag old_style_tag . lifetime_end_ts = now_ts old_style_tag . save ( ) except TagToRepositoryTag . DoesNotExist : pass return tag
Deletes the given tag by marking it as expired.
Deletes the given tag by marking it as expired .
"""
    Deletes the given tag by marking it as expired.
    """ # TODO: Remove the linkage code once RepositoryTag is gone.
tag
now_ms