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

request(ratelimits): data export/inport support #719

Open
1 task done
JuanPablo2655 opened this issue Mar 2, 2024 · 1 comment
Open
1 task done

request(ratelimits): data export/inport support #719

JuanPablo2655 opened this issue Mar 2, 2024 · 1 comment

Comments

@JuanPablo2655
Copy link

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

I want to export ratelimit data and save them in a database when my application goes offline and have the ability to import it back once the application comes back online.

Desired solution

For rateLimitManager to have an export and import function.

Alternatives considered

I haven't concidered any other alternatives because the sapphire framework has cooldowns already built-in that use this library.

Additional context

No response

@favna
Copy link
Member

favna commented Mar 2, 2024

I'm down for adding this feature but running timers are not serializable, they use setInterval

public override set(id: K, value: RateLimit<K>): this {
this.sweepInterval ??= setInterval(this.sweep.bind(this), RateLimitManager.sweepIntervalDuration);
return super.set(id, value);
}

I have no idea how this can be realised.

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

No branches or pull requests

2 participants