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

Feat : Link Expiry Management #79

Closed

Conversation

Nazi-pikachu
Copy link
Collaborator

@Nazi-pikachu Nazi-pikachu commented Jul 19, 2023

Description

This draft pull request introduces the link expiry feature, allowing links to automatically expire after a specified period. The implementation includes the necessary backend changes, database schema modifications, and frontend updates.

Related Issue

#22
#52

Proposed Changes

  • Schema Prisma is modified to support the state and expiry of link

Relavant ScreenShots

image

Checklist

  • I have tested the changes locally and they are functioning as expected

Additional Notes

By default the value of state is Draft and the expiry date can be null to indicate that ther is no expiration date set by the user.

@Nazi-pikachu
Copy link
Collaborator Author

Media1.mp4

Hey @yuvrajsab
This is a the draft implementation of link-expiry.
In redirect service we are already fetching the params and since we need to add state and expiry as params filed we can utilize it to check the expiration date.
There are few drawback of this approach

  1. One is that it makes no difference to the user that whether the link has expired or the link is not found.
  2. Removal of Expired link : I am thinking of tackling this using a cron job

Changes this will cause:

By using performance hooks (perf_hooks) i can notice an increase of 1ms in response time.

<style type="text/css"></style>
S.NO After(ms) Before(ms)
1 2.484800041 0.2505000234
2 0.6238999963 0.07190001011
3 1.095600009 0.06980001926
4 0.771600008 0.1779000163
5 0.796399951 0.07929998636
     
AVG 1.154460001 0.1298800111
     
DIFF 1.02457999 ms
     

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.

None yet

1 participant