by

Where communities thrive


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

    jmrozanec on master

    Implement suggestion from #318 … (compare)

  • May 01 14:44

    jmrozanec on master

    Update travis (compare)

  • May 01 14:41

    jmrozanec on master

    Update travis file Update travis file (compare)

  • May 01 14:36

    jmrozanec on master

    Fix travis file (compare)

  • May 01 14:24

    jmrozanec on master

    Add test for issue #424 (compare)

  • May 01 14:05

    jmrozanec on master

    Add TravisCI fast finish option. Update versions at pom.xml to a… Fix #426 with right Spring cron… and 4 more (compare)

  • Apr 27 09:46

    jmrozanec on master

    Issue 423: Strange results for … Merge pull request #425 from ja… (compare)

  • Apr 27 06:16

    jmrozanec on master

    Issue 421 test Merge pull request #422 from Ha… (compare)

  • Apr 27 06:16

    jmrozanec on master

    added testQuartzEvery7DaysStart… . . and 1 more (compare)

  • Apr 27 06:15

    jmrozanec on master

    Check for case where hash is th… Merge pull request #419 from Sh… (compare)

  • Mar 21 07:26

    jmrozanec on master

    Fix NPE when checking cron cons… Merge pull request #416 from sk… (compare)

  • Mar 21 07:25

    jmrozanec on master

    Fix NPE when field definition d… Merge pull request #415 from sk… (compare)

  • Feb 28 13:45

    jmrozanec on master

    Change dependency version to on… Merge branch 'master' of https:… (compare)

  • Jan 17 13:39

    jmrozanec on master

    Fix interval notation in period… simplify and fix the test Merge pull request #414 from me… (compare)

  • Nov 13 2019 13:57

    jmrozanec on master

    Fix for optional fields mapping Merge pull request #410 from ma… (compare)

  • Nov 11 2019 12:53

    jmrozanec on master

    Fix for incorrect time sequence… Merge pull request #409 from ma… (compare)

  • Nov 05 2019 09:03

    jmrozanec on master

    Added test for issue #404 Merge pull request #405 from br… (compare)

  • Nov 05 2019 09:03

    jmrozanec on master

    Create Issue406Test.java Actua… Merge pull request #407 from mi… (compare)

  • Oct 19 2019 11:22

    jmrozanec on master

    Changes to convert cron from on… Merge pull request #400 from fa… (compare)

  • Oct 13 2019 11:51

    jmrozanec on master

    Update README.md (compare)

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
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.
stephenprakash
@stephen5prakash_twitter

useful web developer tools link

Alternative for lodash and underscore
https://onlinedevtools.in/lodash_underscore_alternative

Format your SQL queries online
https://onlinedevtools.in/online/sqlformatter

Find your npm package size and dependency
https://onlinedevtools.in/online/npmpackageanalyzer

Convert your curl to HTTP request online
https://onlinedevtools.in/curl

explain and create cronjob online
https://onlinedevtools.in/crontab

Latest, useful trending programming and development related blogs
https://onlinedevtools.in/devnews

Compare your text file online
https://diffviewer.onlinedevtools.in