Skip to content

[mock_uss] Cleanup rid database#1363

Open
the-glu wants to merge 4 commits intointeruss:mainfrom
Orbitalize:garbage_collection_on_mocks_2
Open

[mock_uss] Cleanup rid database#1363
the-glu wants to merge 4 commits intointeruss:mainfrom
Orbitalize:garbage_collection_on_mocks_2

Conversation

@the-glu
Copy link
Contributor

@the-glu the-glu commented Feb 24, 2026

Similar to #1361 and #1364 , but for notifications/flights on rid side.

Automatically cleanup notifications >1h, to avoid notification build-up and test record flights.

Contribute to #1059

@the-glu the-glu force-pushed the garbage_collection_on_mocks_2 branch from c749406 to 8ae7aa7 Compare February 24, 2026 08:45
@the-glu the-glu marked this pull request as draft February 24, 2026 09:36
@the-glu
Copy link
Contributor Author

the-glu commented Feb 24, 2026

Setting that one in draft, and waiting on #1364

@the-glu the-glu force-pushed the garbage_collection_on_mocks_2 branch from b1b4367 to 6148705 Compare March 4, 2026 11:03
@the-glu the-glu changed the title [mock_uss] Cleanup rid notifications [mock_uss] Cleanup rid database Mar 4, 2026
@the-glu the-glu force-pushed the garbage_collection_on_mocks_2 branch from 6148705 to 20271a1 Compare March 4, 2026 11:07
@the-glu the-glu marked this pull request as ready for review March 4, 2026 11:08
@the-glu
Copy link
Contributor Author

the-glu commented Mar 4, 2026

Setting that one in draft, and waiting on #1364

Ready for review :)

Copy link
Contributor

@mickmis mickmis left a comment

Choose a reason for hiding this comment

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

LGTM modulo comments

flight
for flight in self.flights
if flight.get_span()[1]
and flight.get_span()[1] + FLIGHTS_LIMIT > arrow.utcnow().datetime # pyright: ignore[reportOptionalOperand]
Copy link
Contributor

Choose a reason for hiding this comment

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

pyright is not smart enough to ignore this on its own given the first condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually he is smart, because as it's a function, it may return a different value the second time ^^'

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh
Not that we want that though

Does this work? Just learned about assignment expressions

Suggested change
and flight.get_span()[1] + FLIGHTS_LIMIT > arrow.utcnow().datetime # pyright: ignore[reportOptionalOperand]
if (end_time := flight.get_span()[1])
and end_time + FLIGHTS_LIMIT > arrow.utcnow().datetime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants