K
K
Kr1stian2021-07-03 13:25:46
Python
Kr1stian, 2021-07-03 13:25:46

Is it possible to set the time before deleting a value from a variable?

There is a variable with user id, is it possible to somehow set the time after which a certain id will be deleted from the variable?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Morrowind, 2021-07-03
@hekkaaa

Well, you can wrap the function in a thread that will walk as a demon and clear the necessary variables.
About streams here

A
Antonio Solo, 2021-07-03
@solotony

you probably need to keep track of the time it was added to the list, that is, add not only the ID but now ()
and then check at the right points and, if necessary, delete the old ones.
you can do cleaning in a separate thread, depending on what kind of task

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question