Skip to content

Commit

Permalink
fix connection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgiolaga committed May 28, 2023
1 parent 1c3a5af commit 6142b2d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion db/connection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import psycopg2
from db.config import config

""" Connect to the PostgreSQL database server """
def connect():
conn = None
try:
Expand Down
1 change: 1 addition & 0 deletions db/cursor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connection = None
4 changes: 1 addition & 3 deletions db/queries.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from utils.constants import default_target, default_time, table_name, default_message
from psycopg2 import sql
from utils.utils import compute_next_wednesday
from db.connection import connect

connection = connect()
from db.cursor import connection

def create_bamboo_chat_id_row(chat_id):
pitch = "Crespi Sport Village \n" \
Expand Down
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
from callbacks.help_func import help_func
from callbacks.echo import echo
from callbacks.bamboo import bamboo
from db.connection import connect
import db.cursor as db_cursor
import logging
import os

logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)

if __name__ == '__main__':
db_cursor.connection = connect()

updater = Updater(token=token, use_context=True)
dispatcher = updater.dispatcher

Expand Down

0 comments on commit 6142b2d

Please sign in to comment.