fmn.cache.tracked module

class fmn.cache.tracked.Tracked(packages: set = <factory>, containers: set = <factory>, modules: set = <factory>, flatpaks: set = <factory>, usernames: set = <factory>, agent_name: set = <factory>)[source]

Bases: object

agent_name: set
containers: set
flatpaks: set
modules: set
packages: set
usernames: set
class fmn.cache.tracked.TrackedCache(requester: Requester, rules_cache: RulesCache)[source]

Bases: CachedValue

Used to quickly know whether we want to process an incoming message.

It can be called outside of the message-processing loop to refresh the cache.

Cases when the cache should be refreshed: - a rule is changed - a user is added or removed to/from a group - an artifact has their owners (users or groups) changed

The Consumer listens to those events as messages on the bus.

If this happens too frequently, we can just refresh after X minutes have passed and tell users that their changes will take X minutes to be active.

async get_value(db: AsyncSession)[source]
async invalidate_on_message(message: Message)[source]
name = 'tracked'