Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

[ECO-1828] Fix volume calculations with cast to jsonb; facilitate concurrency #32

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

xbtmatt
Copy link
Contributor

@xbtmatt xbtmatt commented Jun 10, 2024

  • Convert all values to jsonb before using them. This is the column of the data field ultimately
    • Specifically the value in GET_DAILY_VOLUME() needs to be casted to jsonb: $1.volume_events::jsonb
  • Change CREATE FUNCTION GET_DAILY_VOLUME => CREATE OR REPLACE GET_DAILY_VOLUME
  • Change IF NOT EXISTS ... INSERT to INSERT <initialize_volume_logic> ON CONFLICT ... DO NOTHING to let the db handle concurrency. Same as the insertion we do with UPDATE_LATEST_STATE
  • Manually test the changes by triggering volume updates with two markets
    • One with existing volume
    • One with no volume

@xbtmatt xbtmatt changed the title Lint [ECO-1828] Fix volume calculations with cast to jsonb; facilitate concurrency Jun 10, 2024
@xbtmatt xbtmatt force-pushed the ECO-1828 branch 2 times, most recently from 678939c to 847c64d Compare June 10, 2024 22:12
@xbtmatt xbtmatt requested a review from alnoki June 10, 2024 22:13
xbtmatt pushed a commit that referenced this pull request Jun 10, 2024
@xbtmatt xbtmatt force-pushed the ECO-1828 branch 4 times, most recently from 650557f to eabf1e7 Compare June 10, 2024 22:32
@alnoki alnoki merged commit a95718d into emojicoin-dot-fun Jun 10, 2024
1 check passed
@CRBl69 CRBl69 deleted the ECO-1828 branch June 18, 2024 22:20
CRBl69 pushed a commit that referenced this pull request Jul 2, 2024
CRBl69 pushed a commit that referenced this pull request Jul 3, 2024
CRBl69 pushed a commit that referenced this pull request Jul 5, 2024
CRBl69 pushed a commit that referenced this pull request Jul 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants