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

Introduce ttl option #3

Closed
EthanThatOneKid opened this issue Sep 22, 2023 · 3 comments · Fixed by #5 or #7
Closed

Introduce ttl option #3

EthanThatOneKid opened this issue Sep 22, 2023 · 3 comments · Fixed by #5 or #7
Assignees
Labels
enhancement New feature or request

Comments

@EthanThatOneKid
Copy link
Contributor

EthanThatOneKid commented Sep 22, 2023

The introduction of the ttl (time to live) option will enable users to set a specific lifespan for shortened links.

Proposed solution

  • We will add a new optional parameter, ttl, to the link-shortening functionality. Users can specify a time in seconds for how long the shortened link should remain active.
  • Additionally, we will implement a daily GitHub workflow that cleans up expired links based on their TTL.

Implementation plan

  1. Add the ttl option to the link-shortener, allowing users to specify a TTL for each shortened link.
  2. Create a daily GitHub workflow that identifies and deletes links that have exceeded their TTL.
  3. Implement storage of TTL data separately using Deno Kv.

This enhancement will provide more control over the lifespan of shortened links and improve overall link management.

@EthanThatOneKid EthanThatOneKid self-assigned this Sep 22, 2023
@EthanThatOneKid EthanThatOneKid added the enhancement New feature or request label Sep 22, 2023
@EthanThatOneKid
Copy link
Contributor Author

EthanThatOneKid commented Sep 30, 2023

Alternatively, we apparently can now schedule future events with Deno’s queue API1.

Footnotes

  1. https://deno.com/blog/queues

@EthanThatOneKid
Copy link
Contributor Author

EthanThatOneKid commented Oct 7, 2023

The TTL feature is not working in production. In the meantime, I'll work on https://github.com/EthanThatOneKid/deno_queues to completely diagnose the issue.

@EthanThatOneKid
Copy link
Contributor Author

The TTL feature now officially is working in production. TODO: #8.

Discord conversation:

[6:30 PM]Ethan (he/Webmaster): Checking if this PR #7 worked (since I am testing on production of this project).
[6:31 PM]
BOT
oss.acmcsuf.com/shorter: Created commit update /example shortlink!

This shortlink will expire <t:1697074456:R>.
[6:36 PM]Ethan (he/Webmaster): OMG the TTL seems to have mcflippin worked :capycool:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant