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

fix: Reduce janitor scope to only local tenants #1303

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

filipecabaco
Copy link
Member

@filipecabaco filipecabaco commented Feb 20, 2025

What kind of change does this PR introduce?

Reduce janitor scope to only local tenants
Screenshot 2025-02-20 at 09 58 38

Copy link

vercel bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
realtime-demo ⬜️ Ignored (Inspect) Visit Preview Feb 20, 2025 11:04am

@coveralls
Copy link

coveralls commented Feb 20, 2025

Coverage Status

coverage: 81.521% (-0.1%) from 81.617%
when pulling 4cbe660 on fix/janitor-reduce-scope
into 74bbfca on main.

@@ -65,7 +65,7 @@ defmodule Realtime.Tenants.Janitor do
Logger.info("Janitor started")
%{chunks: chunks, tasks: tasks} = state
all_tenants = :ets.select(@table_name, [{{:"$1"}, [], [:"$1"]}])
connected_tenants = :ets.select(@syn_table, [{{:"$1", :_, :_, :_, :_, :_}, [], [:"$1"]}])
connected_tenants = :ets.select(@syn_table, [{{:"$1", :_, :_, :_, :_, Node.self()}, [], [:"$1"]}])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet match specs. Technically it probably should be {:const, Node.self()} but I think that it will not cause any issues there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do the change so it's more correct

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-02-20 at 11 02 38 yeah this is better and more correct :D

@filipecabaco filipecabaco merged commit 1c780b5 into main Feb 20, 2025
4 checks passed
@filipecabaco filipecabaco deleted the fix/janitor-reduce-scope branch February 20, 2025 11:13
@kiwicopple
Copy link
Member

🎉 This PR is included in version 2.34.26 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants