Delete chats older than 2 days #1906
rikhuijzer
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To avoid chats accumulating, I made a little script that cleans up any chats that are older than 48 hours (you can change this of course). I wrote this script in Rust for two reasons. The first reason is that Rust is in my experience rock-solid. The second reason is see reason one. If you prefer another scripting language, it should be pretty easy to convert this code via an LLM.
The following is my script which I called
cleanup-openui.rs
. With small modifications, this script could work for other people too. Instructions for building and setting up a cronjob are in the comments:Note that the script has some strict checks especially to ensure that the
updated_at
contains Unix timestamps. It's very important that the time formats match because otherwise SQLite might delete all chat history instead of only older than 48 hours.Beta Was this translation helpful? Give feedback.
All reactions