mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-07-04 12:15:24 +02:00
Remove global header when the bot is not connected to the database
This commit is contained in:
@ -7,7 +7,6 @@ from sqlalchemy.ext.declarative import declarative_base
|
||||
|
||||
import json
|
||||
import discord
|
||||
import time
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
@ -16,7 +15,6 @@ from titanembeds.database.messages import Messages
|
||||
from titanembeds.database.guild_members import GuildMembers
|
||||
from titanembeds.database.unauthenticated_users import UnauthenticatedUsers
|
||||
from titanembeds.database.unauthenticated_bans import UnauthenticatedBans
|
||||
from titanembeds.database.keyvalue_properties import KeyValueProperties
|
||||
|
||||
from titanembeds.utils import get_message_author, get_message_mentions, get_webhooks_list, get_emojis_list, get_roles_list, get_channels_list, list_role_ids
|
||||
|
||||
@ -289,15 +287,3 @@ class DatabaseInterface(object):
|
||||
dbuser.revoked = True
|
||||
session.commit()
|
||||
return "Successfully kicked **{}#{}**!".format(dbuser.username, dbuser.discriminator)
|
||||
|
||||
async def send_webserver_heartbeat(self):
|
||||
async with threadpool():
|
||||
with self.get_session() as session:
|
||||
key = "bot_heartbeat"
|
||||
q = session.query(KeyValueProperties).filter(KeyValueProperties.key == key)
|
||||
if q.count() == 0:
|
||||
session.add(KeyValueProperties(key=key, value=time.time()))
|
||||
else:
|
||||
firstobj = q.first()
|
||||
firstobj.value = time.time()
|
||||
session.commit()
|
||||
|
Reference in New Issue
Block a user