Skip to content
Snippets Groups Projects
Commit e79bca4b authored by Dariusz Kędzierski's avatar Dariusz Kędzierski
Browse files

Merge fixes

parent 5a685202
No related branches found
No related tags found
5 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!16Dk issue 3 concurrent block query rebase,!15Dk issue 3 concurrent block query
...@@ -78,6 +78,9 @@ class Db: ...@@ -78,6 +78,9 @@ class Db:
assert self._is_write_query(sql), sql assert self._is_write_query(sql), sql
return self._query(sql, **kwargs) return self._query(sql, **kwargs)
def query_no_return(self, sql, **kwargs):
self._query(sql, **kwargs)
def query_all(self, sql, **kwargs): def query_all(self, sql, **kwargs):
"""Perform a `SELECT n*m`""" """Perform a `SELECT n*m`"""
res = self._query(sql, **kwargs) res = self._query(sql, **kwargs)
......
...@@ -436,6 +436,7 @@ if _parent_author != '' THEN ...@@ -436,6 +436,7 @@ if _parent_author != '' THEN
CASE CASE
WHEN root_id=-1 THEN php.id WHEN root_id=-1 THEN php.id
ELSE root_id ELSE root_id
END
FROM hive_posts FROM hive_posts
WHERE hive_posts.id=php.id WHERE hive_posts.id=php.id
) as root_id, ) as root_id,
...@@ -492,7 +493,7 @@ END IF; ...@@ -492,7 +493,7 @@ END IF;
END END
$function$ $function$
""" """
db.query_row(sql) db.query_no_return(sql)
def reset_autovac(db): def reset_autovac(db):
"""Initializes/resets per-table autovacuum/autoanalyze params. """Initializes/resets per-table autovacuum/autoanalyze params.
......
...@@ -197,7 +197,7 @@ class Posts: ...@@ -197,7 +197,7 @@ class Posts:
sql = """ sql = """
SELECT id, author_id, permlink_id, parent_id, community_id, is_valid, is_muted, depth SELECT id, author_id, permlink_id, parent_id, community_id, is_valid, is_muted, depth
FROM add_hive_post(:author, :permlink, :parent_author, :parent_permlink, :date, :community_support_start_date); FROM add_hive_post((:author)::varchar, (:permlink)::varchar, (:parent_author)::varchar, (:parent_permlink)::varchar, (:date)::timestamp, (:community_support_start_date)::timestamp);
""" """
row = DB.query_row(sql, author=op['author'], permlink=op['permlink'], parent_author=op['parent_author'], row = DB.query_row(sql, author=op['author'], permlink=op['permlink'], parent_author=op['parent_author'],
...@@ -342,7 +342,7 @@ class Posts: ...@@ -342,7 +342,7 @@ class Posts:
updated_at = :date, updated_at = :date,
depth = :depth, depth = :depth,
is_muted = :is_muted, is_muted = :is_muted,
is_valid = :is_valid, is_valid = :is_valid
WHERE id = :id WHERE id = :id
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment