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 option to run only once #25

Merged
merged 8 commits into from
Jan 24, 2023
Merged

Conversation

MPParsley
Copy link
Contributor

@MPParsley MPParsley commented Jan 16, 2023

Added option RUNONCE.

It will shutdown the process after running it once.

Useful when running the service as a Kubernetes CronJob:

kind: CronJob
apiVersion: batch/v1
metadata:
  name: ldes-consumer-cronjob
spec:
  schedule: '* * * * *'
  concurrencyPolicy: Forbid
  suspend: false
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: ldes-consumer
              env:
                - name: RUNONCE
                  value: true
                - name: CRON_PATTERN
                  value: * * * * * *
              ports:
                - containerPort: 8080
                  protocol: TCP
              imagePullPolicy: IfNotPresent
              image: redpencilio/ldes-consumer
          restartPolicy: OnFailure
          securityContext: {}
          schedulerName: default-scheduler

README.md Outdated Show resolved Hide resolved
app.ts Outdated Show resolved Hide resolved
app.ts Outdated Show resolved Hide resolved
app.ts Outdated Show resolved Hide resolved
config.ts Outdated Show resolved Hide resolved
@MPParsley MPParsley changed the title Add option to run as a job Add option to run only once Jan 16, 2023
@nvdk nvdk requested a review from elpoelma January 20, 2023 09:03
@elpoelma elpoelma merged commit 83baf5a into redpencilio:master Jan 24, 2023
@elpoelma elpoelma added the enhancement New feature or request label Jan 24, 2023
@MPParsley MPParsley deleted the patch-1 branch January 24, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants