I want to split my TinyDB
JSONs to be one per day.
I wonder if there is some function to trigger a function call once the day is changed and return to the same spot it was in the code. There is only db.insert
in the code so I might want to lock/serialize that part..
For example every day at 00:00:00 time the following function will get called:
change_db():
db = TinyDB('/stream_' + datetime.date.today() + '.json')