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

Set up ttl queue #5

Merged
merged 11 commits into from
Oct 1, 2023
Merged

Set up ttl queue #5

merged 11 commits into from
Oct 1, 2023

Conversation

EthanThatOneKid
Copy link
Contributor

I created a queue with the Deno Queue API with a channel of "ttl".

This allows users to define a time-to-live for their shortlink which will be deleted from the database after the desired duration has elapsed.

Resolves #3.

main.ts Outdated Show resolved Hide resolved
1. Refactored the way commit messages are composed and formatted.
2. Added support for displaying TTL information in the success message if a TTL (Time to Live) duration is provided.
3. Enqueued a delete operation when a TTL is set to automatically delete the shortlink after the specified time.
4. Handled errors gracefully using error checking.

These changes should enhance the readability and functionality of the code related to commit creation and TTL management.

Resolves <#5 (comment)>. Suggested by @karnikaavelumani.
```
gcp-us-east1
Error: Invalid force
    at makeShorterOptions (file:///src/main.ts:211:11)
    at handle (file:///src/main.ts:110:25)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async ext:deno_http/00_serve.js:442:22
10/1/2023, 1:56:42 PM
```
Oops

```
gcp-us-east1
Queues are not supported for preview deployments. Enqueued messages will be dropped.
10/1/2023, 1:55:05 PM
```
Bruh
@EthanThatOneKid
Copy link
Contributor Author

EthanThatOneKid commented Oct 1, 2023

Progress:
image

Copy link
Contributor

@karnikaavelumani karnikaavelumani left a comment

Choose a reason for hiding this comment

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

Looks really good! Thank you for your hard work. 🐻

Incorrect output:

```
Created commit [update `/example` shortlink](https://acmcsuf.com/code/commit/0333b548246fbddd8c309637f06fd31b14d6f805)!

This shortlink will be expire in <t:1696195785765:R>.
```
@EthanThatOneKid EthanThatOneKid merged commit 89fce1f into main Oct 1, 2023
3 checks passed
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.

Introduce ttl option
2 participants