-
-
Notifications
You must be signed in to change notification settings - Fork 554
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
Add configurable history length #447
Conversation
This allows servers to decide the max length of each history item they want to store! Some users might have much larger history lines than others. This setting can be set to 0 to allow for unlimited history length. This is not recommended for a public server install, but for a private one it can work nicely.
@@ -0,0 +1,2 @@ | |||
-- Add migration script here | |||
alter table history alter column data type text; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text has no max size, unlike varchar
@@ -19,7 +19,7 @@ pub mod settings; | |||
pub async fn launch(settings: Settings, host: String, port: u16) -> Result<()> { | |||
let host = host.parse::<IpAddr>()?; | |||
|
|||
let postgres = Postgres::new(settings.db_uri.as_str()) | |||
let postgres = Postgres::new(settings.clone()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Settings is also used below, and I'm lazy 🤐
@@ -33,6 +34,7 @@ impl Settings { | |||
.set_default("host", "127.0.0.1")? | |||
.set_default("port", 8888)? | |||
.set_default("open_registration", false)? | |||
.set_default("max_history_length", 8192)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8192 is the old default set in the database schema, so behaviour does not change
This allows servers to decide the max length of each history item they
want to store! Some users might have much larger history lines than
others.
This setting can be set to 0 to allow for unlimited history length. This
is not recommended for a public server install, but for a private one it
can work nicely.
Resolves #416