mirror of
https://github.com/Casvt/MIND.git
synced 2026-04-25 03:00:20 -04:00
Refactored db.py
This commit is contained in:
@@ -13,6 +13,7 @@ from os.path import abspath, dirname, exists, isfile, join, splitext
|
||||
from secrets import token_bytes
|
||||
from shutil import copy2, move
|
||||
from sys import base_exec_prefix, executable, platform, version_info
|
||||
from threading import current_thread
|
||||
from typing import Callable, Iterable, List, Sequence, Set, Tuple, Union, cast
|
||||
|
||||
from apprise import Apprise, LogCapture
|
||||
@@ -169,6 +170,15 @@ def search_filter(query: str, result: GeneralReminderData) -> bool:
|
||||
)
|
||||
|
||||
|
||||
def current_thread_id() -> int:
|
||||
"""Get the ID of the current thread.
|
||||
|
||||
Returns:
|
||||
int: The ID.
|
||||
"""
|
||||
return current_thread().native_id or -1
|
||||
|
||||
|
||||
# region Security
|
||||
def get_hash(salt: bytes, data: str) -> bytes:
|
||||
"""Hash a string using the supplied salt.
|
||||
|
||||
Reference in New Issue
Block a user