Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Root797346yOne of my previous jobs had a similar issue, except it was actually a design choice by the OAuth2 library (Doorkeeper).
I purged all of the expired tokens and reduced the database size by about 55%. Size, not rowcount. Over half the database was useless oauth2 garbage.
I yelled at the maintainers, but they didn't care. -
Konsole30496y@Root In this case, the code is abt an year old and the dev "forgot" to make a cron, after writing a todo 😑
-
Konsole30496y@Root And what do you mean by didn't care...😮
50% db size seems a lot to care about -
Root797346y@Konsole The server was primarily a login server for both a game and third-party clan/fan sites, and was live for 3-4 years, so 55% made sense.
Why didn't the maintainers care? They didn't think it would ever be an issue. and if it was, you just could clear them out manually. After, you know, figuring out how. 🙄 -
If there's one thing one learned, then it's that todo is short for never... Man, at least write it down so that we can give it the lowest possible priority and stop pretending like we're going to do it.
-
Root797346y@ihatecomputers
"Hmmm, I'm bored. What to do..."
`grep TODO * -r | more`
... nope. Nope nope nope. screw that. It's Netflix time. -
Konsole30496y@Root @ihatecomputers Just asking... Are TODOs really used in actual projects out there?
-
@Konsole I see them all the time! Especially in the parts that no one wants to touch 🤔 it's fun reading things like "temporary", "soon...", "fix when..." and then seeing that the comment is five years old. Classic.
-
Hey here's an idea...
Every time a user logs in, check if x minutes/ hours/ etc. hasp passed since last token cleanup. If it has, start a token cleanup process.
No need for cron. -
Konsole30496y@AlgoRythm Won't that be too intensive. Say 100 users login in span of an hour, there really isn't a need to check 4 expired tokems
Related Rants
Guess why the tokens were being piled up...
rant
pending tasks
python
django
expired_tokens
todo