Skip to content
Snippets Groups Projects
Commit aa6bda69 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Fixed SQL function attribute

parent ca465e5c
No related branches found
No related tags found
4 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!45Fixed query counting children for posts collected during sync.
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#pylint: disable=too-many-lines #pylint: disable=too-many-lines
import time import time
from time import perf_counter
import logging import logging
import sqlalchemy import sqlalchemy
...@@ -174,12 +176,17 @@ class DbState: ...@@ -174,12 +176,17 @@ class DbState:
index.create(engine) index.create(engine)
time_start = perf_counter()
# Update count of all child posts (what was hold during initial sync) # Update count of all child posts (what was hold during initial sync)
sql = """ sql = """
select update_hive_posts_children_count() select update_hive_posts_children_count()
""" """
row = DbState.db().query_row(sql) row = DbState.db().query_row(sql)
time_end = perf_counter()
log.info("[INIT] update_hive_posts_children_count executed in %fs", time_end - time_start)
# TODO: #111 # TODO: #111
#for key in cls._all_foreign_keys(): #for key in cls._all_foreign_keys():
# log.info("Create fk %s", key.name) # log.info("Create fk %s", key.name)
......
...@@ -658,9 +658,7 @@ def setup(db): ...@@ -658,9 +658,7 @@ def setup(db):
CREATE OR REPLACE FUNCTION public.update_hive_posts_children_count() CREATE OR REPLACE FUNCTION public.update_hive_posts_children_count()
RETURNS void RETURNS void
LANGUAGE 'plpgsql' LANGUAGE 'plpgsql'
VOLATILE
COST 100
STABLE
AS $BODY$ AS $BODY$
BEGIN BEGIN
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment