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

Reload config on SIGHUP #222

Closed
wants to merge 2 commits into from
Closed

Reload config on SIGHUP #222

wants to merge 2 commits into from

Conversation

N-R-K
Copy link
Contributor

@N-R-K N-R-K commented Jun 6, 2024

Seems to work okay from some cursory tests. But since the code wasn't written with a reload-able config in mind, there might be bugs lurking.

Keeping this a draft now, until a more careful and thorough review.

@cdown
Copy link
Owner

cdown commented Jun 7, 2024

Unless there's substiantial demand I'd be inclined to avoid config reloading, or at least do it without the minefield of signal involvement.

@N-R-K
Copy link
Contributor Author

N-R-K commented Jun 8, 2024

This was more of a "other deamons do it and seems like easy to add support for" rather than "i need this feature" thing. If someone really needed to have a new config, just restarting clipmenud works fine and retains previous clips. So yeah, this is probably not worthwhile.


Slightly off topic, but what exactly is max_clips_batch supposed to do? This is the only place where it's used, and it doesn't really make much sense to me:

    if ((int)cur_clips > cfg.max_clips_batch) {
        expect(cs_trim(&cs, CS_ITER_NEWEST_FIRST, (size_t)cfg.max_clips) == 0);
    }

Was it meant to be cur_clips > cfg.max_clips + cfg.max_clips_batch?

EDIT: see #225

@N-R-K
Copy link
Contributor Author

N-R-K commented Jun 8, 2024

just restarting clipmenud works fine

This made me realize, you could simply re-exec instead of re-reading config and get a fully clean state. Updated the patch. Let me know if you find this approach acceptable. Otherwise I can drop the PR, as it's not too important for me.

@N-R-K N-R-K closed this Nov 10, 2024
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.

2 participants