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

"Actioned events" is empty all the time #45

Closed
OmgImAlexis opened this issue Oct 23, 2021 · 3 comments
Closed

"Actioned events" is empty all the time #45

OmgImAlexis opened this issue Oct 23, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@OmgImAlexis
Copy link

Seems that actioned events max kept is based on total events not actioned ones meaning after x events the "actions events" page is cleared.

@FoxxMD
Copy link
Owner

FoxxMD commented Jan 3, 2022

It is based on actioned events. From SubredditResources.ts

async addActionedEvent(ae: ActionedEvent) {
    const events = await this.cache.wrap(`actionedEvents-${this.subreddit.display_name}`, () => []) as ActionedEvent[];
    events.unshift(ae);
    await this.cache.set(`actionedEvents-${this.subreddit.display_name}`, events.slice(0, this.actionedEventsMax), {ttl: 0});
}

This behavior may be a result of the default cache store using lru-cache. The default max store size is 500 keys -- if there are many things being cached it may be that the KV for actioned events is being dropped because it is too infrequently set. Trying to verify this now...

@FoxxMD FoxxMD added the bug Something isn't working label Jan 3, 2022
@OmgImAlexis
Copy link
Author

@FoxxMD you should be storing two caches, one for all events and one for actioned. This way the last 500 actioned events are also cached. Personally I'd like to enable a mode to store all actioned ones forever. I have more than enough memory in my server to handle this. (128GB)

@FoxxMD
Copy link
Owner

FoxxMD commented May 12, 2022

I'm closing this as it should be solved by switching to database persistence in v0.11.0. If anyone has this issue still I can re-open.

@FoxxMD FoxxMD closed this as completed May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants