Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 28 10:44

    jmrozanec on master

    Minor fixes for Travis build. (compare)

  • Jul 28 10:40

    jmrozanec on master

    Modify how exception message is… (compare)

  • Jul 28 10:04

    jmrozanec on master

    #391: Fixes issue by replacing … (compare)

  • Jul 22 08:04

    jmrozanec on master

    Update travis jdk 8->9 (compare)

  • Jul 22 07:55

    jmrozanec on master

    Add test for issue #388 - Wrong… Comment out test Merge branch 'ms3eed-issue-388' (compare)

  • Jul 15 08:31

    jmrozanec on master

    Remove println (compare)

  • Jul 08 06:41

    jmrozanec on gh-pages

    Update index.html (compare)

  • Jul 08 06:40

    jmrozanec on master

    Update README.md (compare)

  • Jul 03 20:07

    jmrozanec on 9.0.1

    (compare)

  • Jul 03 17:28

    jmrozanec on master

    Version 9.0.1-SNAPSHOT -> 9.0.1 Update version 9.0.1 -> 9.0.2-S… (compare)

  • Jun 28 06:03

    jmrozanec on master

    Correctly parse last DoW values Merge branch 'pkoenig10-dow' (compare)

  • Jun 17 15:19

    jmrozanec on gh-pages

    Update version (compare)

  • Jun 17 15:18

    jmrozanec on master

    Update README.md (compare)

  • Jun 17 15:14

    jmrozanec on master

    Update version to 9.0.0 Update version 9.0.0 -> 9.0.1-S… (compare)

  • Jun 17 15:11

    jmrozanec on 9.0.0

    Update version to 9.0.0 (compare)

  • Jun 17 15:10

    jmrozanec on 9.0.0

    (compare)

  • Jun 17 15:09

    jmrozanec on 9.0.0

    (compare)

  • Jun 17 15:08

    jmrozanec on master

    Update pom.xml to version 9.0.0 (compare)

  • Jun 17 13:05

    jmrozanec on master

    Update README.md (compare)

  • Jun 17 13:00

    jmrozanec on master

    Fix comments (compare)

jmrozanec
@jmrozanec
@/all we reached 100 forks! 🎉🎉🎉🎉 Thank you all for supporting cron-utils! :smile:
Xin Wang
@lovepoem
👏👏👏
Matthias
@Naxos84
Happy new year to everyone!
jmrozanec
@jmrozanec
@/all Happy New Year! :smile:
jmrozanec
@jmrozanec
@/all New release available! Details available here Many thanks to @Naxos84 @SvenssonWeb @rhanton @jpotts2 @tanyona @meincs @curioustechizen ! :smile:
Anshul Garg
@garganshu
is there any cron-utils library which i can use in android studio
for my android project?
jmrozanec
@jmrozanec
@garganshu sure! You can use the versiones 6.x.y That should work well. Please let us know if you have any issues. You can expect a new release soon with the fix proposed at #309
Anshul Garg
@garganshu
I m new to android. So, can you tell me the steps on how to add on the library in my project?
bdw thanks @jmrozanec
Francis De Brabandere
@francisdb
hey @jmrozanec :+1: for managing this project like a boss
and of course also :+1: for all contributors!
jmrozanec
@jmrozanec
@francisdb Thanks! :smile:
@garganshu I would suggest to check the snippet for the corresponding version at mvn-repository You will find snippets on how to declare the dependency for various dependency managers (for Android you will be most probably using Gradle) Let us know if you need further help on this. Best!
jmrozanec
@jmrozanec
@/all we now support weekdays computation between two dates! You can choose a weekend policy, specify holidays and get an accurate count :smile:
Gowtham Kittusamy
@gowtk
Hi Team , Please remove the log4j.properties file in the cron-utils-7.0.1 jar, Its overriding our own logging mechanism
jmrozanec
@jmrozanec
@gowtk Hi! will work on that and create a new release asap :smile: You are also welcome to contribute!
Gowtham Kittusamy
@gowtk
@jmrozanec Thanks team
jmrozanec
@jmrozanec
@/all we received jmrozanec/cron-utils#318 if would be possible to handle multiple crons in a single expression. We commented on how this could be achieved when building a string pattern and started developing the feature in a branch. We would be glad to hear opinions and suggestions regarding the feature and its implementation.
jmrozanec
@jmrozanec
@/all multi-cron support is implemented! A new release will follow this weekend! We are working on how to provide better human readable descriptions and experimenting if some machine learning can be applied to achieve it. If anyone would like to jump in, is welcome to do so! The reference issue will be jmrozanec/cron-utils#3
Daniel Stauffer
@nerd-shark
@/all I'm trying to use Quartz cron expression: <0/60 * * * * ?>, but am getting an IllegalArgumentException: Period 60 not in range (0, 59] (java.lang.IllegalArgumentException)
com.cronutils.model.field.expression.visitor.ValidationFieldExpressionVisitor:173 (null)
Daniel Stauffer
@nerd-shark
that is a good cron expression afaik
Francis De Brabandere
@francisdb
@nerd-shark please create a ticket, looks like a bug indeed
Matthias
@Naxos84
Every 60 seconds is the same as every minute. 0 ? Which means every minute at second 0.
jmrozanec
@jmrozanec
@Naxos84 @francisdb thanks for jumping in! @nerd-shark If considered a valid expression, please file a ticket with a test case and we will consider the issue. Contributions are always welcome! :smile:
Phani Cherukuri
@phanicherukuri
Hi,
My company has a spring-boot micro-service applications, and I am looking for a jobs which can perform "git pull", "git pull before push". Is there any way to write such jobs for Java applications (btw we're using GITLAB as a SCM), I know that there is cron API for PHP applications, is there any such thing for Java applications also?
jmrozanec
@jmrozanec
Sure there is! We have no mature scheduler yet, so will advise you to use Quartz for job scheduling.
jmrozanec
@jmrozanec
@/all New release available! Details available here Many thanks to @hokkun-dayo @catharsis @Naxos84 @kangtajt007 @SvenssonWeb @mattadamson @TuomasKiviaho @alenkacz @kensipe @roddy @toby1984 @morvael @francisdb @MrKulp for reporting issues, discussing them and submitting PRs with fixes and features. The new release includes an updated Dutch translation, bugfixes such as avoid an infinite loop when seeking impossible dates, truncation at milliseconds level when computing past executions; and features such as workdays computation for next/past executions, support for multiple cron expressions in a single expression and crons serialization.
Xin Wang
@lovepoem
👏👏👏
Ken Sipe
@kensipe
👏👏👏
jmrozanec
@jmrozanec
Hi @/all ! We are working towards providing much better cron descriptions using machine learning methods. We already have a working model for English language, which we hope to release within a month. In order to support the rest of the languages, we require to generate datasets with examples for each of them. To achieve it, we coded some generators, which create valid samples based on some descriptions. Help to code dataset generators for the rest of the languages will be highly appreciated. We are tracking the issue under #3 and coding the generators at this repo: https://github.com/jmrozanec/cron-utils-datagen Thanks! :smile:
ctonsing
@ctonsing
Hi team, thanks so much for your work on this wonderful utility! I am just running into a problem: I am creating a Cron object from this expression "0 0 ? 7-1 *". When I try to find the last execution time by calling ExecutionTime.lastExecution(now), it gets stuck. I can see in SingleExecutionTime.potentialPreviousClosestMatch() method it keeps going to last day of previous month looking for a potential match. This should not be the case. The description of the above expression is correctly given as "every hour every day between Saturday and Sunday". Any assistance would be appreciated!
ctonsing
@ctonsing
hmm, i see, it doesn't like the "7-1" part, doesn't wrap around...
jmrozanec
@jmrozanec
@ctonsing Hi! thank you for reaching out! May we ask you for some more code in order to reproduce the issue? Are you using quartz/unix/... format? Which version of the utility do you use? We just released version 7.0.4 which fixes an issue regarding infinite loops while looking for a match. Thanks!
ctonsing
@ctonsing

@jmrozanec Thank you very much for your response! I am indeed using v7.0.4
My pom.xml includes:

    <dependency>
        <groupId>com.cronutils</groupId>
        <artifactId>cron-utils</artifactId>
        <version>7.0.4</version>
    </dependency>

The code you can use to replicate the problem is as follows (sorry, I see I copied the schedule expression incorrectly in my previous message...):

    String schedule = "0 0 * ? * SAT-SUN *";
    CronParser parser = new CronParser(cronDefinition);
    Cron quartzCron = parser.parse(schedule);

    CronDescriptor descriptor = CronDescriptor.instance();
    String description = descriptor.describe(quartzCron);
    System.out.println(description);

    ZonedDateTime time = ZonedDateTime.now();
    ExecutionTime executionTime = ExecutionTime.forCron(quartzCron);

    // Time from last execution to now
    Duration timeFromLastExecution = executionTime.timeFromLastExecution(time).get();
    System.out.println(timeFromLastExecution.toMinutes());
ctonsing
@ctonsing
@jmrozanec I believe the problem is probably in the com.cronutils.model.time.generator.BetweenDayOfWeekValueGenerator(CronField cronField, int year, int month, WeekDay mondayDoWValue) constructor. Since the schedule expression is "SAT-SUN", the constructor's "from" variable is 7 and the "to" variable is 1, which means the body of the for loop is never entered...
jmrozanec
@jmrozanec
@ctonsing great! :smile: May we ask you to open an issue and provide this code as a test by a PR? You are welcome to help us solve the issue!
ctonsing
@ctonsing
@jmrozanec done. I hope I have done the PR correctly, let me know if anything is incorrect/unclear.
jmrozanec
@jmrozanec
@/all new version 7.0.6 was released! Many thanks to @pkoenig10 @minidmnv @charleshope @cbgxhub @soriniulus @Naxos84 for reporting and fixing issues! The release solves an infinite loop issue when computing previous/next date as well as fixes issues with custom cron definitions with 3 fields. We also thank @chbakouras for providing us with Greek locales: we can now read descriptions in Greek language!
@/all with all these improvements we also reached 1K commits! :smile:
Nbooo
@nbooo_gitlab
Hi there! Latest build contains a fix of 336 which is quite important. Any estimate when 7.0.7 will appear on maven central? Thanks )
jmrozanec
@jmrozanec
@nbooo_gitlab we are releasing a new version this weekend! Thanks! :smile:
Nbooo
@nbooo_gitlab
Great news :) Thank you!
jmrozanec
@jmrozanec
@nbooo_gitlab @all new version was released: 7.0.7 alias "James Bond" :smile: Special thanks to @pangyikhei @Naxos84 @ctonsing @dmitrijs-rjazanovs for contributing fixes, tests as well as reporting issues. Thanks!
Sandeep Gupta
@iamsandeepgupta
can anyone tell me how to achieve this
angular-cron-jobs/angular-cron-jobs#70.
jmrozanec
@jmrozanec
@iamsandeepgupta thank you for reaching out. We have no experience with angular-cron-jobs - please refer to their repo for more info. You are welcome to use cron-utils on backend - we can help to any related issues that arise on using it. Best!
Avi Cohen
@avico927_gitlab

Hi, I'm trying to understand how to use the parser in order to compute next execution based on the last execution.
is this code should work?

ZonedDateTime lastExecution = ZonedDateTime.ofInstant(new Date(entity.getEndTime()).toInstant(), ZoneId.systemDefault());
executionTime.lastExecution(lastExecution);
ZonedDateTime now = ZonedDateTime.now();
final long millis = executionTime.timeToNextExecution(now).get().toMillis();

jmrozanec
@jmrozanec
@avico927_gitlab here a gist with a working implementation: https://gist.github.com/jmrozanec/5d5554bd47a94ad42807547e0948d7dc
Please let us know if further help is needed! :smile: Best!
jmrozanec
@jmrozanec
@/all we are happy to announce a new cron-utils release with new features and multiple bugfixes :smile: Thanks to everyone who made it possible: @josephtaylor @thebhushanp @palerique @ph-redknee @robryals @pgorin @tubean @NielsDoucet @toughpheeckouse