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

Troubles in docker #499

Closed
fulviodenza opened this issue Aug 6, 2023 · 0 comments
Closed

Troubles in docker #499

fulviodenza opened this issue Aug 6, 2023 · 0 comments

Comments

@fulviodenza
Copy link

fulviodenza commented Aug 6, 2023

Hi, I'm running this code which uses robfig/cron v3.
I have the following snippet:

// run the goroutine with the cron
go func(ctx context.Context, u *objects.Update) {
[...]
	_, err = b.Scheduler.AddFunc(crontab, func() {
		b.Pill(ctx, u)
	})
[...]

And I'm initializing the scheduler in the following way:

s := cron.New()
s.Start()

Running in debug mode with classic configuration of vs code, the scheduler works fine, while if run it in a docker container with a docker image based on the following file, doesn't work:

FROM golang:1.19.5 as builder

# Create and change to the app directory.
WORKDIR /app
ADD . /app

RUN go build -o /pills

CMD [ "/pills" ]

Logs from the application are not useful since the application runs correctly, just seems to ignore jobs.
I don't know if this is a useful information but the app is running in a railway deployment.
I've seen there were already some open issues in running jobs in docker containers but they seems to be quite old.

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

No branches or pull requests

1 participant