Skip to content
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

Merged
merged 2 commits into from
Jun 10, 2022
Merged

Add configurable history length #447

merged 2 commits into from
Jun 10, 2022

Conversation

ellie
Copy link
Member

@ellie ellie commented Jun 10, 2022

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

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;
Copy link
Member Author

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())
Copy link
Member Author

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)?
Copy link
Member Author

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

conradludgate
conradludgate previously approved these changes Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make server history item length configurable
2 participants