Skip to content
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: add database cleanup function #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShamanthOP
Copy link
Contributor

Closes #43

Added a function to remove stale documents from participants and active_pairs collection. It is scheduled to run everyday at 1:00 A.M.

Participant documents which do not have a corresponding active room and Active_pair documents older than a day gets removed by the function.

@chandansgowda chandansgowda added enhancement New feature or request aip-2023 Part of AOSSIE Internship Program 2023 labels Oct 22, 2023
@chandansgowda
Copy link
Member

Can we schedule it to run each and every hour or so ? Will there be any issues ? Also, @Aarush-Acharya does this cause any conflict to the discussions feature you are implementing ?

@ShamanthOP
Copy link
Contributor Author

Can we schedule it to run each and every hour or so ? Will there be any issues ? Also, @Aarush-Acharya does this cause any conflict to the discussions feature you are implementing ?

We can but it wouldn't add any significant benifits. Since it's a background task performance isn't an issue. So executing it once a day seems right.

@chandansgowda
Copy link
Member

@ShamanthOP If we dont do it frequently, inactive rooms will be displayed along with other rooms and users might be trying to join those.

@ShamanthOP
Copy link
Contributor Author

@ShamanthOP If we dont do it frequently, inactive rooms will be displayed along with other rooms and users might be trying to join those.

Inactive rooms should be cleared up by the webhook receiver. We can add it here also to be super extra careful though. This PR currently only cleans participants and active_pairs collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aip-2023 Part of AOSSIE Internship Program 2023 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloud function to delete inactive rooms and active pair chats
2 participants