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

Feature: Dynamic Cache Entry Expiry #199

Merged
merged 3 commits into from
Mar 11, 2024
Merged

Conversation

TanmayDhobale
Copy link
Contributor

This pull request enhances the existing Cache utility by introducing the capability to set dynamic expiry times fvor each cache entry. Previously the cache expiry time was statically set, limiting the utility's flexibility. With this update, users can specify the expiry time in seconds for each set operation, allowing for more nuanced cache control tailored to specific need.

Copy link
Contributor

@hkirat hkirat left a comment

Choose a reason for hiding this comment

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

Why so much lint diff?
Was the file not linted correctly before or is it bonked right now?

src/db/Cache.ts Outdated
new Date().getTime() +
parseInt(process.env.CACHE_EXPIRE_S || '100', 10) * 1000,
});
set(type: string, args: string[], value: any, expiryInSeconds: number = 3600): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should defualt to

new Date().getTime() +
        parseInt(process.env.CACHE_EXPIRE_S || '100', 10) * 1000

@hkirat
Copy link
Contributor

hkirat commented Mar 11, 2024

lint seems bonked now
Screenshot 2024-03-11 at 8 18 16 PM

@TanmayDhobale
Copy link
Contributor Author

@hkirat ummm significant lint difference could indicate a file was not previously linted according to the current project's linting rules, or the linting configuration has been updated or corrected can u pls check now

@TanmayDhobale TanmayDhobale requested a review from hkirat March 11, 2024 15:13
@hkirat hkirat merged commit c029acf into code100x:main Mar 11, 2024
1 check passed
@hkirat
Copy link
Contributor

hkirat commented Mar 11, 2024

/bounty $25

@TanmayDhobale
Copy link
Contributor Author

Let's goooooo

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