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

Move CheckTraktToken to a Job #1201

Merged
merged 3 commits into from
Nov 17, 2024
Merged

Move CheckTraktToken to a Job #1201

merged 3 commits into from
Nov 17, 2024

Conversation

krbrs
Copy link
Contributor

@krbrs krbrs commented Nov 15, 2024

Move CheckTraktToken to a Job that runs every 12h instead of spamming the log every few minutes.

The refresh of a fairly old token worked on my dev machine, but I'd be happy if someone else could check

Move CheckTraktToken to a Job that runs every 12h instead of spamming the log every few minutes
Copy link
Member

@revam revam left a comment

Choose a reason for hiding this comment

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

A side effect of running it in the queue is that if the queue is paused for too long at the end of the expiring period then it will miss the timeframe to refresh the token, while running it on a timer outside the queue is not affected by this.

@da3dsoul can correct me if I'm wrong about this though.

Shoko.Server/Scheduling/Jobs/Trakt/CheckTraktTokenJob.cs Outdated Show resolved Hide resolved
return Task.CompletedTask;
}

// Convert the Unix timestamp to DateTime
Copy link
Member

Choose a reason for hiding this comment

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

We should also probably add a check if the date is in the past, and unset the token if it is instead of trying to refresh.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If everybody is okay with my reply below, I'll mark this as resolved

@krbrs
Copy link
Contributor Author

krbrs commented Nov 16, 2024

My token expired months ago (in February) and was refreshed properly (in November), so you don't have to unset it because you would have to link it again while the app is still approved on Trakt. I'll look into the other things, currently it would work and is just migrated code

and check if true or false in the Job
Copy link
Member

@revam revam left a comment

Choose a reason for hiding this comment

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

Last batch of requested changes. 😔

@revam revam merged commit c24465c into ShokoAnime:master Nov 17, 2024
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