zcaudate-me / cronj Goto Github PK
View Code? Open in Web Editor NEWmoved -> 'hara.io.scheduler'
Home Page: http://docs.caudate.me/hara/hara-io-scheduler.html
moved -> 'hara.io.scheduler'
Home Page: http://docs.caudate.me/hara/hara-io-scheduler.html
Ran into an interesting bug that I am not sure how to solve. The above should run every 5 minutes but instead it is running every 10 minutes on the 5s (05, 15, 25, 35 ...). Any idea on why this might be. P.S. Thanks for cronj it saved me a lot of time recently.
Thanks for writing and providing cronj, Chris. We're using it in production and the simulation capability is proving indispensible!
my project used cronj for auto task,but have an issue it is that the task feign death , none log to print, what's happen with it?
if pre-hook had exception ,there is no capture,which will cause handler to hang up. so that other all tasks will hang up too.
Hi, I'm getting a bunch of warnings when I import cronj which seem to be manifestations of this hara issue: zcaudate/hara#5
It would be nice if cronj's dependencies could be updated to use hara 2.1.12 or better, which fixes these warnings.
Hi,
Would you please add a changelog.
Thanks!
Hi,
Is there a way to specify the timezone in which the cronj should interpret the crontab specs?
Thanks,
R
Total newbie to Clojure here, and i'd like to ask you what is the proper way to import cronj
?
The only way (yeah i tried a lot) to work for me was:
(ns starter.core
(:require [cronj.core :refer :all])
(:gen-class))
Which just dont feels right.
Also maybe it would be usefull to add a tip about it to documentation.
Thanks!
In my project.clj
I have included [cronj "0.1.0"]
, and lein deps
retrieves the package fine. But when I run lein repl
I get:
Exception in thread "main" java.lang.RuntimeException: EOF while reading, starting at line 185, compiling:(cronj/core.clj:307)
at clojure.lang.Compiler.compile(Compiler.java:7190)
at clojure.lang.RT.compile(RT.java:387)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:400)
at clojure.core$load$fn__4890.invoke(core.clj:5415)
at clojure.core$load.doInvoke(core.clj:5414)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5227)
at clojure.core$load_lib.doInvoke(core.clj:5264)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$load_libs.doInvoke(core.clj:5298)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$require.doInvoke(core.clj:5381)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at cumtd_api$loading__4784__auto__.invoke(cumtd_api.clj:1)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3382)
at clojure.lang.Compiler.compile1(Compiler.java:7035)
at clojure.lang.Compiler.compile1(Compiler.java:7025)
at clojure.lang.Compiler.compile(Compiler.java:7097)
at clojure.lang.RT.compile(RT.java:387)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:400)
at clojure.core$load$fn__4890.invoke(core.clj:5415)
at clojure.core$load.doInvoke(core.clj:5414)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5227)
at clojure.core$compile$fn__4895.invoke(core.clj:5426)
at clojure.core$compile.invoke(core.clj:5425)
at user$eval7.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6511)
at clojure.lang.Compiler.eval(Compiler.java:6501)
at clojure.lang.Compiler.eval(Compiler.java:6477)
at clojure.core$eval.invoke(core.clj:2797)
at clojure.main$eval_opt.invoke(main.clj:297)
at clojure.main$initialize.invoke(main.clj:316)
at clojure.main$null_opt.invoke(main.clj:349)
at clojure.main$main.doInvoke(main.clj:427)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: EOF while reading, starting at line 185
at clojure.lang.Util.runtimeException(Util.java:170)
at clojure.lang.LispReader.readDelimitedList(LispReader.java:1117)
at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962)
at clojure.lang.LispReader.read(LispReader.java:180)
at clojure.lang.Compiler.compile(Compiler.java:7094)
... 45 more
Compilation failed: Subprocess failed
Am I doing something wrong, or is there an error in the version of cronj
I’ve downloaded? I’m using Clojure 1.4.0 and Leiningen 2.0.0-preview8.
I'm using cronj with Stuart Sierra's component library, and am running into a bit of a problem.
I'm planning to run a number of tasks, each of which are contained within their own component. Currently, I initialize all of those first, and then have the scheduler depend upon all of the task components.
Logically, I would rather start the scheduler first, and then have each task schedule itself upon initialization.
After perusing the cronj source, I came upon the schedule-task
function, which seems to allow for this kind of functionality. I would start the scheduler with an empty vector of entries, and then attempt to call schedule-task
with the cronj instance and task -- resulting in a SO.
schedule-task
is not present in the documentation, but does seem to be part of a public api. Am I using it incorrectly, or is it not ready for prime-time?
I'm happy to create a sample repo demonstrating this.
I'm using cronj
as a substitute of cron for a clojure project. When using cron
on other projects I always have a task that run every hour and create some entry log, so I know that cron
is no broken (sometimes because a bad entry definition). Is there a way in cronj
to define a task that have access to the task-scheduler
without doing the following?:
(declare cj)
(defn handler []
(let [workflows-task (cronj/get-task cj "start-workflows-task")]
{:running (cronj/running? cj)
:uptime (cronj/uptime cj)
:tasks (cronj/get-ids cj)
:start-workflows-enabled (:enabled workflows-task)
:start-workflows-schedule (:schedule workflows-task)}))
(def log-cronj-status-task
{:id "log-cronj-status-task"
:handler handler
:schedule "0 0 1 * * * *"
:opt {}})
(def cj (cronj/cronj :entries [log-cronj-status-task]))
Declaring cj in the environment just for the purpose of handler
can access to it, feels hacky to me, but I cannot see a way around it other than pass the task-scheduler reference as a parameter on the task definition.
First - thanks for this.
Second, it would be really useful to manually start a scheduled task, but to ensure that only one execution was happening at a time, so if the scheduled task was running then nothing would happen or alternatively this request would be queued. And conversely, if it is running manually then the scheduled task is a no-op/queued.
I could achieve this with an atom but I thought I would ask here.
Is there a possibility to add a task with a schedule for a started scheduler? I have two cases where this would be great to have:
Thank you for answer.
Links point to websites whose domain is parked
in repl can't stop task
when I Loading src/automation/temp1.clj... done
the task can't stop or shutdown
why DEPRECATED
What do you think about adding a persistence mechanism to cronj? By persistence I mean the ability to resume tasks from the last shutdown of the scheduler.
Do you think it's a viable idea?
http://docs.caudate.me/cronj/ still states 1.4.1 as the current release.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.