Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 15 07:21

    jmrozanec on master

    fixed some tests in italian Merge pull request #492 from al… (compare)

  • Oct 10 19:05

    jmrozanec on master

    Update pom.xml with JDK 16. (compare)

  • Oct 10 18:53

    jmrozanec on master

    #446 when dst overlaps, skip du… Merge pull request #490 from In… (compare)

  • Oct 10 18:53

    jmrozanec on master

    Enable unit tests for #430 and … Merge pull request #489 from In… (compare)

  • Oct 10 18:52

    jmrozanec on master

    See #480 The unit test didn't … retain only jdk 16 github test … Merge pull request #488 from In… (compare)

  • Oct 10 18:52

    jmrozanec on master

    test for java 17 Merge pull request #487 from al… (compare)

  • Oct 06 07:32

    jmrozanec on master

    Merge pull request #3 from jmro… Merge branch 'jmrozanec:master'… removed unused import and 3 more (compare)

  • Oct 03 06:22

    jmrozanec on master

    Describe "always ..." for HHMMSS Update .gitignore. Update pom.x… Merge branch 'mccartney-fixing-… (compare)

  • Sep 13 10:00

    jmrozanec on master

    Issue 480 test sout -> logger Merge remote-tracking branch 'o… and 1 more (compare)

  • Jun 28 07:57

    jmrozanec on master

    Add an Automatic-Module-Name T… Merge pull request #479 from oc… (compare)

  • May 02 08:32

    jmrozanec on master

    Add test for issue #477 Merge pull request #478 from ar… (compare)

  • Apr 22 19:02

    jmrozanec on master

    Reformat pom.xml (compare)

  • Apr 22 18:55

    jmrozanec on master

    Replace string for constant. (compare)

  • Apr 22 18:51

    jmrozanec on master

    Update README.md (compare)

  • Apr 22 18:41

    jmrozanec on master

    Update .travis.yml (compare)

  • Apr 22 18:37

    jmrozanec on master

    Update to JaCoCo code coverage (compare)

  • Apr 22 18:10

    jmrozanec on master

    Bugfix: compare same types. (compare)

  • Apr 22 17:04

    jmrozanec on master

    Issue #475: Fix Javadoc error. Merge branch 'master' of https:… (compare)

  • Apr 22 16:51

    jmrozanec on master

    Update README.md (compare)

  • Apr 22 15:00

    jmrozanec on master

    Update pom.xml (compare)

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
Ghost
@ghost~5db6e3a2d73408ce4fcf374d
Hello, I think that I've hit into a bug. When using Quartz to express every n years starting in year X, on a particular day, lastExecution is incorrect. (if you even do isMatch on what it generates, it produces false). Even doing lastExecution on what's generated from nextExecution generates an incorrect result.
anomaliyao
@anomaliyao
Hi! Tell me please, how can I install cron-utils in order to use it in jenkins pipeline?
jmrozanec
@jmrozanec
@anomaliyao can you please elaborate a bit more on this?
jmrozanec
@jmrozanec
@/all a new release was published today! cron-utils 9.1.2 is out, with many fixes, described in the release page Special thanks to @jaguililla @natros @francisdb @benoitbb @albuhuba @lpbak @pangyikhei @lowell80 @LennyKarpel @Naxos84 @Blemicek @sbandler @IndeedSi @HongZhaoHua @littleYanzi @albertotn @edmeme @zhanxingcheng @zhanxingcheng @charchithere @barunhalderkolkata for reporting, discussing, and providing solutions to the issues!
Neil Shah
@neilmshah

Hi, I'm trying to check if two cron expressions overlap at any point:
cron1 = "0 0 10 1/1 ? "; //everyday at 10am
cron2 = "0 0 10 ? MON "; //every monday at 10am

The above two expressions have an overlap. Can someone tell me if/how I can check this using cron-utils?

Fernando Rodrigues Cardoso
@Nando-Cardoso
I've been trying to use portuguese as language, but no success yet. Can someone tell my how to do the Locale for portuguese langauge