2024-01-23 12:45:44 +10:00
|
|
|
|
|
|
|
from global_conf import CONFIG
|
|
|
|
|
|
|
|
#### https://docs.python-arango.com/en/main/
|
|
|
|
from arango import ArangoClient
|
|
|
|
|
2024-01-24 14:09:31 +10:00
|
|
|
import logging
|
|
|
|
|
2024-01-23 12:45:44 +10:00
|
|
|
|
|
|
|
|
|
|
|
def get_dicks_collection():
|
2024-01-23 15:12:59 +10:00
|
|
|
try:
|
|
|
|
arango_client = ArangoClient(hosts=CONFIG['databaso']['host'] )
|
|
|
|
pipisa_db = arango_client.db(
|
|
|
|
CONFIG['databaso']['base'],
|
|
|
|
username=CONFIG['databaso']['user'],
|
|
|
|
password=CONFIG['databaso']['pass']
|
|
|
|
)
|
|
|
|
dicks_collection = pipisa_db.collection(CONFIG['databaso']['collection'])
|
|
|
|
|
|
|
|
return dicks_collection
|
|
|
|
except Exception as e:
|
2024-01-24 14:09:31 +10:00
|
|
|
logging.error('ошибка DB при взятии коллекции пипис')
|
|
|
|
logging.error(e)
|
2024-01-23 15:12:59 +10:00
|
|
|
|
|
|
|
|
|
|
|
def get_posts_removal_collection():
|
|
|
|
try:
|
|
|
|
arango_client = ArangoClient(hosts=CONFIG['databaso']['host'] )
|
|
|
|
pipisa_db = arango_client.db(
|
|
|
|
CONFIG['databaso']['base'],
|
|
|
|
username=CONFIG['databaso']['user'],
|
|
|
|
password=CONFIG['databaso']['pass']
|
|
|
|
)
|
|
|
|
posts_removal_collection = pipisa_db.collection(CONFIG['databaso']['posts_removal_collection'])
|
|
|
|
|
|
|
|
return posts_removal_collection
|
|
|
|
except Exception as e:
|
2024-01-24 14:09:31 +10:00
|
|
|
logging.error('ошибка DB при взятии коллекции постов-на-удаление')
|
|
|
|
logging.error(e)
|