Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
OasisAkari committed Sep 16, 2024
1 parent b3a5418 commit 66c8843
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,17 @@ def check(target_id):
return True
return False

@staticmethod
@retry(stop=stop_after_attempt(3))
@auto_rollback_error
def add(target_id):
session.add(GroupBlockList(targetId=target_id))
session.commit()
return True

@staticmethod
@retry(stop=stop_after_attempt(3))
@auto_rollback_error
def remove(target_id):
entry = session.query(GroupBlockList).filter_by(targetId=target_id).first()
if entry:
Expand Down

0 comments on commit 66c8843

Please sign in to comment.