-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Store user space activty #127
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files📢 Thoughts on this report? Let us know! |
(async () => { | ||
try { | ||
await main(); | ||
process.exit(0); | ||
} catch (e) { | ||
console.error(e); | ||
process.exit(1); | ||
} | ||
})(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to run it every time the server starts? 🙈 We have 5 containers running. this may increase the load on the DB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this script is to be ran manually, only once to generate the counters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no way to run manually on a single container I think 🤔 if we trigger it on DO's console will it continue to run even if we close browser? i didn't try it before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not try either. In worst case, we leave the browser open until the task end, or we pipe the command to null (add > &
at the end, which send the task to the background).
Ideally, we should handle that with a queue system (was proposed in a pitch in cycle 3)
|
src/writer/delete-proposal.ts
Outdated
UPDATE user_space_activities | ||
SET proposals_count = proposals_count - 1 | ||
WHERE user = ? AND space = ? | ||
LIMIT 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens to votes_count of user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Computed via refreshVotes below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tAck
…hot-labs/snapshot-sequencer into update-user-space-counters
Co-authored-by: Chaitanya <[email protected]>
From https://www.notion.so/snapshotlabs/S-delegation-part-2-2b3186d8a33b4fd8b90c6575b6bf8000#bc7c1c9c785c46bdad69b4c8337771ca and snapshot-labs/snapshot-hub#653
votes_count
on new votesproposals_count
on new proposalproposals_count
on proposal deletionvotes_count
on proposal deletionproposals_count
on space soft-deletionvotes_count
on space soft-deletionUse-cases not handled, due to them not being done through sequencer
Update the(space should be hard-deleted)votes_count
on space re-activationUpdate the(space should be hard-deleted)proposals_count
on space re-activationUpdate the(space migration should be deprecated)votes_count
on space migrationUpdate the(space migration should be deprecated)proposals_count
on space migration