-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: TheBoatyMcBoatFace <[email protected]>
- Loading branch information
1 parent
27f8162
commit 2a563dd
Showing
7 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
# app/__init__.py | ||
from .utils import configure_monitoring, logger | ||
from dotenv import load_dotenv | ||
|
||
from .database.postgres.connect import test_connection | ||
|
||
from .processes import start_processes | ||
|
||
def startup(): | ||
logger.info('Starting up...') | ||
load_dotenv() | ||
configure_monitoring() | ||
test_connection() | ||
start_processes() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
-- app/database/postgres/queries/clothe_domains.sql | ||
-- Creates url entry | ||
UPDATE targets.domains d | ||
UPDATE targets.domains | ||
SET home_url = :home_url | ||
WHERE id = :domain_id | ||
RETURNING id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- app/database/postgres/queries/upsert_url.sql | ||
INSERT INTO targets.urls (url, domain_id) | ||
VALUES (:home_url, :domain_id) | ||
ON CONFLICT (url) DO UPDATE SET url = :home_url, domain_id = :domain_id | ||
RETURNING id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# run.py | ||
from app import startup | ||
from app.processes import start_processes | ||
|
||
def main(): | ||
startup() | ||
start_processes() | ||
|
||
startup() | ||
if __name__ == '__main__': | ||
main() |