Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
e0fc0ca3
Commit
e0fc0ca3
authored
4 years ago
by
Marcin
Browse files
Options
Downloads
Patches
Plain Diff
issue#37: correct pending payout
parent
7f237953
No related branches found
No related tags found
4 merge requests
!456
Release candidate v1 24
,
!230
Setup monitoring with pghero
,
!135
Enable postgres monitoring on CI server
,
!81
Mi issue 37 wrong pending payout
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hive/db/schema.py
+25
-24
25 additions, 24 deletions
hive/db/schema.py
hive/server/condenser_api/objects.py
+2
-1
2 additions, 1 deletion
hive/server/condenser_api/objects.py
with
27 additions
and
25 deletions
hive/db/schema.py
+
25
−
24
View file @
e0fc0ca3
...
@@ -590,6 +590,7 @@ def setup(db):
...
@@ -590,6 +590,7 @@ def setup(db):
hp.depth,
hp.depth,
hp.promoted,
hp.promoted,
hp.payout,
hp.payout,
hp.pending_payout,
hp.payout_at,
hp.payout_at,
hp.is_paidout,
hp.is_paidout,
hp.children,
hp.children,
...
@@ -731,7 +732,7 @@ def setup(db):
...
@@ -731,7 +732,7 @@ def setup(db):
sql
=
"""
sql
=
"""
DROP TYPE IF EXISTS database_api_post CASCADE;
DROP TYPE IF EXISTS database_api_post CASCADE;
CREATE TYPE database_api_post AS (
CREATE TYPE database_api_post AS (
id INT,
id INT,
community_id INT,
community_id INT,
author VARCHAR(16),
author VARCHAR(16),
permlink VARCHAR(255),
permlink VARCHAR(255),
...
@@ -785,7 +786,7 @@ def setup(db):
...
@@ -785,7 +786,7 @@ def setup(db):
AS
AS
$function$
$function$
BEGIN
BEGIN
RETURN QUERY
RETURN QUERY
SELECT
SELECT
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
...
@@ -823,7 +824,7 @@ def setup(db):
...
@@ -823,7 +824,7 @@ def setup(db):
AS
AS
$function$
$function$
BEGIN
BEGIN
RETURN QUERY
RETURN QUERY
SELECT
SELECT
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
...
@@ -863,7 +864,7 @@ def setup(db):
...
@@ -863,7 +864,7 @@ def setup(db):
AS
AS
$function$
$function$
BEGIN
BEGIN
RETURN QUERY
RETURN QUERY
SELECT
SELECT
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
...
@@ -881,11 +882,11 @@ def setup(db):
...
@@ -881,11 +882,11 @@ def setup(db):
root_author >= _root_author AND
root_author >= _root_author AND
root_permlink >= _root_permlink AND
root_permlink >= _root_permlink AND
hp.id >= (SELECT id FROM hive_posts_view hp1 WHERE hp1.author >= _start_post_author AND hp1.permlink >= _start_post_permlink ORDER BY id LIMIT 1)
hp.id >= (SELECT id FROM hive_posts_view hp1 WHERE hp1.author >= _start_post_author AND hp1.permlink >= _start_post_permlink ORDER BY id LIMIT 1)
ORDER BY
ORDER BY
root_author ASC,
root_author ASC,
root_permlink ASC,
root_permlink ASC,
id ASC
id ASC
LIMIT
LIMIT
_limit
_limit
;
;
END
END
...
@@ -905,7 +906,7 @@ def setup(db):
...
@@ -905,7 +906,7 @@ def setup(db):
AS
AS
$function$
$function$
BEGIN
BEGIN
RETURN QUERY
RETURN QUERY
SELECT
SELECT
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
...
@@ -947,7 +948,7 @@ def setup(db):
...
@@ -947,7 +948,7 @@ def setup(db):
AS
AS
$function$
$function$
BEGIN
BEGIN
RETURN QUERY
RETURN QUERY
SELECT
SELECT
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
...
@@ -962,14 +963,14 @@ def setup(db):
...
@@ -962,14 +963,14 @@ def setup(db):
WHERE
WHERE
NOT hp.is_muted AND
NOT hp.is_muted AND
NOT hp.is_deleted AND
NOT hp.is_deleted AND
hp.parent_author >= _parent_author AND
hp.parent_author >= _parent_author AND
hp.updated_at >= _updated_at AND
hp.updated_at >= _updated_at AND
hp.id >= (SELECT id FROM hive_posts_view hp1 WHERE hp1.author >= _start_post_author AND hp1.permlink >= _start_post_permlink ORDER BY id LIMIT 1)
hp.id >= (SELECT id FROM hive_posts_view hp1 WHERE hp1.author >= _start_post_author AND hp1.permlink >= _start_post_permlink ORDER BY id LIMIT 1)
ORDER BY
ORDER BY
hp.parent_author ASC,
hp.parent_author ASC,
hp.updated_at ASC,
hp.updated_at ASC,
hp.id ASC
hp.id ASC
LIMIT
LIMIT
_limit
_limit
;
;
END
END
...
@@ -988,7 +989,7 @@ def setup(db):
...
@@ -988,7 +989,7 @@ def setup(db):
AS
AS
$function$
$function$
BEGIN
BEGIN
RETURN QUERY
RETURN QUERY
SELECT
SELECT
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.id, hp.community_id, hp.author, hp.permlink, hp.title, hp.body,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
hp.category, hp.depth, hp.promoted, hp.payout, hp.payout_at, hp.is_paidout,
...
@@ -1003,14 +1004,14 @@ def setup(db):
...
@@ -1003,14 +1004,14 @@ def setup(db):
WHERE
WHERE
NOT hp.is_muted AND
NOT hp.is_muted AND
NOT hp.is_deleted AND
NOT hp.is_deleted AND
hp.author >= _author AND
hp.author >= _author AND
hp.updated_at >= _updated_at AND
hp.updated_at >= _updated_at AND
hp.id >= (SELECT id FROM hive_posts_view hp1 WHERE hp1.author >= _start_post_author AND hp1.permlink >= _start_post_permlink ORDER BY id LIMIT 1)
hp.id >= (SELECT id FROM hive_posts_view hp1 WHERE hp1.author >= _start_post_author AND hp1.permlink >= _start_post_permlink ORDER BY id LIMIT 1)
ORDER BY
ORDER BY
hp.parent_author ASC,
hp.parent_author ASC,
hp.updated_at ASC,
hp.updated_at ASC,
hp.id ASC
hp.id ASC
LIMIT
LIMIT
_limit
_limit
;
;
END
END
...
...
This diff is collapsed.
Click to expand it.
hive/server/condenser_api/objects.py
+
2
−
1
View file @
e0fc0ca3
...
@@ -52,6 +52,7 @@ async def load_posts_keyed(db, ids, truncate_body=0):
...
@@ -52,6 +52,7 @@ async def load_posts_keyed(db, ids, truncate_body=0):
hp.depth,
hp.depth,
hp.promoted,
hp.promoted,
hp.payout,
hp.payout,
hp.pending_payout,
hp.payout_at,
hp.payout_at,
hp.is_paidout,
hp.is_paidout,
hp.children,
hp.children,
...
@@ -200,7 +201,7 @@ def _condenser_post_object(row, truncate_body=0):
...
@@ -200,7 +201,7 @@ def _condenser_post_object(row, truncate_body=0):
post
[
'
cashout_time
'
]
=
json_date
(
None
if
paid
else
row
[
'
payout_at
'
])
post
[
'
cashout_time
'
]
=
json_date
(
None
if
paid
else
row
[
'
payout_at
'
])
post
[
'
total_payout_value
'
]
=
_amount
(
row
[
'
payout
'
]
if
paid
else
0
)
post
[
'
total_payout_value
'
]
=
_amount
(
row
[
'
payout
'
]
if
paid
else
0
)
post
[
'
curator_payout_value
'
]
=
_amount
(
0
)
post
[
'
curator_payout_value
'
]
=
_amount
(
0
)
post
[
'
pending_payout_value
'
]
=
_amount
(
0
if
paid
else
row
[
'
payout
'
])
post
[
'
pending_payout_value
'
]
=
_amount
(
row
[
'
pending_
payout
'
])
post
[
'
promoted
'
]
=
_amount
(
row
[
'
promoted
'
])
post
[
'
promoted
'
]
=
_amount
(
row
[
'
promoted
'
])
post
[
'
replies
'
]
=
[]
post
[
'
replies
'
]
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment