[GH-ISSUE #13] run as daemon? #9

Closed
opened 2026-09-29 12:58:33 +00:00 by slurdge · 6 comments
Owner

Originally created by @kylrth on GitHub (Mar 15, 2022).
Original GitHub issue: https://github.com/slurdge/goeland/issues/13

I know it's easy to just run this as a cron job, but being able to run goeland as a daemon or a Docker container would mean I can manage goeland along with all the other services I may have on the same machine.

I've created an example in this repo that demonstrates how I'm currently building goeland to run as a simple docker-compose service. This works just fine for me, but I wanted to bring it up here to see if you were interested in supporting this kind of usage.

Supporting this could be as simple as adding a goeland daemon subcommand, if you aren't interested in supporting Docker.

Originally created by @kylrth on GitHub (Mar 15, 2022). Original GitHub issue: https://github.com/slurdge/goeland/issues/13 I know it's easy to just run this as a cron job, but being able to run goeland as a daemon or a Docker container would mean I can manage goeland along with all the other services I may have on the same machine. I've created an example in [this repo](https://github.com/kylrth/goeland-docker-service) that demonstrates how I'm currently building goeland to run as a simple docker-compose service. This works just fine for me, but I wanted to bring it up here to see if you were interested in supporting this kind of usage. Supporting this could be as simple as adding a `goeland daemon` subcommand, if you aren't interested in supporting Docker.
Author
Owner

@slurdge commented on GitHub (Mar 15, 2022):

Yes that's a very nice idea. Actually I always wanted to have a proper docker/daemon support, but I didn't take the proper time to do it. Your example is good, however I envision that some people would like more a cron-like way to describe the schedule (in your example, if INTERVAL is 300 and the output is an email then an email would be sent every 5 hours, but maybe you want that only some days etc...).

I'll check if I can find a nice golang package to have cron schedule and then we can add a goeland daemon [--config-file=file.config] type command that would read it.

It goes along with another issue I would like to address: an easy way to have many sources/pipes in one config file. It's already possible in the current format with the pipes and all, but you have to repeat quite a bit of information. Ideally, in daemon mode you would have only one config file and then do everything from it.

From this point, I would also auto build docker images on goeland tags.

I will not have time in the immediate next week, but I'll definitively look into it. Thanks for the suggest!

<!-- gh-comment-id:1068478509 --> @slurdge commented on GitHub (Mar 15, 2022): Yes that's a very nice idea. Actually I always wanted to have a proper docker/daemon support, but I didn't take the proper time to do it. Your example is good, however I envision that some people would like more a cron-like way to describe the schedule (in your example, if `INTERVAL` is 300 and the output is an email then an email would be sent every 5 hours, but maybe you want that only some days etc...). I'll check if I can find a nice golang package to have cron schedule and then we can add a `goeland daemon [--config-file=file.config]` type command that would read it. It goes along with another issue I would like to address: an easy way to have many sources/pipes in one config file. It's already possible in the current format with the pipes and all, but you have to repeat quite a bit of information. Ideally, in daemon mode you would have only one config file and then do everything from it. From this point, I would also auto build docker images on goeland tags. I will not have time in the immediate next week, but I'll definitively look into it. Thanks for the suggest!
Author
Owner

@kylrth commented on GitHub (Mar 16, 2022):

I'm also willing to help with this if you aren't able to get around to it sometime soon. I'm busy through April but after that I might be able to work on this.

<!-- gh-comment-id:1069201180 --> @kylrth commented on GitHub (Mar 16, 2022): I'm also willing to help with this if you aren't able to get around to it sometime soon. I'm busy through April but after that I might be able to work on this.
Author
Owner

@slurdge commented on GitHub (May 5, 2022):

Hello,
Sorry real life went inbetween. Since commit 1b0897b01e there is a 'daemon' command.

You can now specify a value 'cron' on every pipe, for example

[pipe.hackernews]
cron = "@every 5h"

and then run with goeland daemon.

I haven't made a release yet but feel free to test it and discuss if it helps with your use case.

<!-- gh-comment-id:1118725283 --> @slurdge commented on GitHub (May 5, 2022): Hello, Sorry real life went inbetween. Since commit https://github.com/slurdge/goeland/commit/1b0897b01ea1427c8a5867eb00265d77972e4b7d there is a 'daemon' command. You can now specify a value 'cron' on every pipe, for example ```toml [pipe.hackernews] cron = "@every 5h" ``` and then run with `goeland daemon`. I haven't made a release yet but feel free to test it and discuss if it helps with your use case.
Author
Owner

@kylrth commented on GitHub (May 10, 2022):

Hey I've just got this set up and it looks good so far. One suggestion I have as of now: maybe if the user specifies an @every cron it should run once at the beginning as well? That's probably not what the cron package does by default so I'd understand if you don't want to modify the behavior.

<!-- gh-comment-id:1122880137 --> @kylrth commented on GitHub (May 10, 2022): Hey I've just got this set up and it looks good so far. One suggestion I have as of now: maybe if the user specifies an `@every` cron it should run once at the beginning as well? That's probably not what the cron package does by default so I'd understand if you don't want to modify the behavior.
Author
Owner

@slurdge commented on GitHub (May 12, 2022):

Nice! So I have added an additional flag to the daemon command, --run-at-startup. This way, I won't introduce non standard cron behaviour while maintaining the possibility of having a run at the beginning.

Currently debugging a weird issue with reddit rss feeds and I will publish a release.

<!-- gh-comment-id:1125053991 --> @slurdge commented on GitHub (May 12, 2022): Nice! So I have added an additional flag to the daemon command, `--run-at-startup`. This way, I won't introduce non standard cron behaviour while maintaining the possibility of having a run at the beginning. Currently debugging a weird issue with reddit rss feeds and I will publish a release.
Author
Owner

@slurdge commented on GitHub (May 20, 2022):

I've released 0.10.0 which has daemon mode. Thanks @kylrth for the suggestion.

<!-- gh-comment-id:1132581931 --> @slurdge commented on GitHub (May 20, 2022): I've released 0.10.0 which has daemon mode. Thanks @kylrth for the suggestion.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: slurdge/goeland#9
No description provided.