NCrontab | library written | Cron Utils library

 by   atifaziz C# Version: v3.3.2-sn License: Apache-2.0

kandi X-RAY | NCrontab Summary

kandi X-RAY | NCrontab Summary

NCrontab is a C# library typically used in Utilities, Cron Utils applications. NCrontab has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

NCrontab is a library written in C# targeting .NET Standard Library 1.0 and that provides the following facilities:.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              NCrontab has a low active ecosystem.
              It has 765 star(s) with 128 fork(s). There are 24 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 12 open issues and 62 have been closed. On average issues are closed in 45 days. There are 8 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of NCrontab is v3.3.2-sn

            kandi-Quality Quality

              NCrontab has 0 bugs and 0 code smells.

            kandi-Security Security

              NCrontab has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              NCrontab code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              NCrontab is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              NCrontab releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of NCrontab
            Get all kandi verified functions for this library.

            NCrontab Key Features

            No Key Features are available at this moment for NCrontab.

            NCrontab Examples and Code Snippets

            No Code Snippets are available at this moment for NCrontab.

            Community Discussions

            QUESTION

            Azure Function with TimerTrigger shows execution count of 0 despite function running
            Asked 2022-Feb-17 at 08:39

            I have a function app with a single, timer-triggered function running in MS Azure.

            Background

            • The timer runs every 15 seconds with the following NCRONTAB expression: */15 * * * * *
            • Clicking on the "Monitor" tab in the Azure portal shows many successful executions on the expected interval (every 15 seconds)
            • I have proof that the function is indeed running as expected (behavior is to call a web API on each execution, and I can see from the other side of that API that it is indeed being called).

            Problem

            • In the Azure portal on the "Overview" tab of the overall function app, the metric widget showing "Function Execution Count" constantly shows 0 executions.
            • I have attempted to set up an Azure Monitor Alerting Rule in which I am notified any time the single function in this function app has not run at least 15 times in the last 5 minutes. The alert rule is in a persistent state of being activated/fired, presumably since the overall function execution count is always 0.

            Question

            • What might be causing the "Function Execution Count" metric not to update?
            • If it showing 0 is the expected behavior, what is the best practice for implementing an alert for a specific function on a timer trigger not firing as expected (or erroring)?
            ...

            ANSWER

            Answered 2022-Feb-17 at 08:39

            Here is the workaround I did to get the Metrics in Azure Function Portal Overview Tab and the alerts as per the required condition if met:

            Firstly, I checked my Timer Trigger (*/15 * * * * *) Azure Function App running successful in locally for every 15 seconds:

            Configured the Azure Functions to Application Insights in Visual Studio and then Published to the Azure Portal Function App.

            All the metrics, Function Execution Count, Memory working Set, Server Request Time, Server Response Times are recorded while running the Azure Function App Timer Trigger at every 15 seconds as you can see in the screenshot below:

            what is the best practice for implementing an alert for a specific function on a timer trigger not firing as expected (or erroring)?

            To create a Alert:

            Step 1: Go to the Associated Application Insights Resource with the Function App > Select Alerts from Monitoring Section.

            Step 2:

            Click on Create Menu > Alert Rule > Type as Count in the Search Bar and Select the Metric named as Count

            After Selecting the Metric, Make your requirement condition to get alerts as you can see the screenshot below that I made alert rule to the condition for every 5 minutes if function count is below < 15 times.

            After clicking on done, you will see like:

            You'll get the alert rule creation successful notification in the notification bar:

            Run the Function and check the Alerts Page from Monitoring Section in the Azure Application Insights Resource.

            To get more details like Function execution count per minute and the timings, Click on the color bar as you can see the screenshot below when you clicked on it:

            Reference: Monitor Via Application Insights - Alert Rules

            Note:

            my question of why for a function app I previous deployed, the "Function Execution Count" is always ever 0.

            Please check few steps given below:

            • Make Sure You have configured the Application Insights while publishing the Function App as shown in 2nd Image.

            • In the Azure Portal Function App > Under Application Insights option, You have to see this kind of Message: Your app is connected to App Insights Resource:

            • If that message not visible or you can cross check by doing like this: Azure Portal > Function App > Application Insights under Settings > Select the option Change your Resource > Select Existing Resource > Select Your Subscription - Then all the function apps will be appeared in the table, select the deployed function app which you want to track the logs and metrics.

            • Make Sure all the settings under Configuration like AzureWebJobsStorage and WEBSITE_CONTENTAZUREFILECONNECTION are having same storage account connection string/values and the AppInsights Instrumentation Key and its connection string values verify by checking the Application Insights Resources associated with that function app.

            • Also, Please visit this Msft Documentation about enabling the Telemetry in Application Insights.
            Updated Answer:

            Before the workaround for Azure Functions Python Stack - Application Insights, there are some limitations:

            • For the parameters like locations, runtime stack, OS, publish type, resource group or subscription, Application Insights code-less monitoring isn't supported with your selections of the mentioned parameters while creating Azure Function App in the Portal.

            Example: I Selected South India location where Consumption and Premium Hosting plans are not available for my Subscription or the selected Location. If I need for that location, I need to configure through AI SDK as shown below:

            Here is the workaround I did to get the Metrics in Azure Function Portal Overview Tab and the alerts as per the required condition if met:

            Firstly, I checked my Timer Trigger (*/15 * * * * *) Azure Function App running successful in locally for every 15 seconds:

            • And Then Created the Function App in Azure Portal (West US2) along with the integration of Application Insights and deployed to Azure from VS Code.
            • After running the Function from the Azure Portal, All the metrics, Function Execution Count, Memory working Set, Server Request Time, Server Response Times are recorded while running the Azure Function App Timer Trigger at every 15 seconds as you can see in screenshot below:

            what is the best practice for implementing an alert for a specific function on a timer trigger not firing as expected (or erroring)?

            To create a Alert:

            Step 1: Go to the Associated Application Insights Resource with the Function App > Select Alerts from Monitoring Section.

            Step 2:

            Click on Create Menu > Alert Rule > Type as Count in the Search Bar and Select the Metric named as Count

            After Selecting the Metric, Make your requirement condition to get alerts as you can see the screenshot below that I made alert rule to the condition for every 5 minutes if function count is below < 15 times.

            Run the Function and check the Alerts Page from Monitoring Section in the Azure Application Insights Resource.

            Code used in Azure Functions Python Stack:

            host.json:

            Source https://stackoverflow.com/questions/71127556

            QUESTION

            NCRONTAB Expression in Azure WebJobs
            Asked 2021-May-24 at 23:40

            I am looking for the following schedule using CRON Expressions

            Runs every hour from 9 AM to 5 PM => "schedule": "0 0 9-17 * * *" => working

            Runs every 2 hours from 9 AM to 5 PM => "schedule": "0 0/120 9-17 * * *" => not working

            The format per hour is (0-23) hence it is not recognizing.

            How I can achieve the following then? Runs every 2 hours from 9 AM to 5 PM

            https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=csharp#ncrontab-expressions

            https://github.com/atifaziz/NCrontab

            ...

            ANSWER

            Answered 2021-May-24 at 23:40

            Alternative solutions.

            Source https://stackoverflow.com/questions/67670130

            QUESTION

            Trigger Azure Function every 3 months
            Asked 2021-Apr-14 at 13:29

            I'm using a Time-Triggered function to run every 3 months / every 90 days. I am doubting myself and not sure if my expression is good:

            0 0 12 1 1/3 ? *

            Would this ncrontab expression trigger the Azure Function every 3 months?

            ...

            ANSWER

            Answered 2021-Apr-14 at 13:29

            NCRONTAB expressions should only contain six fields:

            Source https://stackoverflow.com/questions/67092415

            QUESTION

            ASP.NET Core 3.1 Hosted Service runs multiple times for a given schedule (its supposed to run once a day)
            Asked 2021-Jan-20 at 23:16

            I've this hosted service job in asp.net core 3.1 application running in the background. In development everything works fine but when I deploy this to production whichever job is inherited from this abstract class will run the ExecuteOnStartAsync() method multiple times. In development when I test the DummyTestJob class. It runs perfectly fine and is called once every 10 seconds. However when I deploy this to production with a job that's supposed to send 1 email once at 2:00am, in the am I will have anywhere between 5-13 emails and this number is arbitrary too. This is deployed on an AWS EC2 Windows machine and I'm not sure if it has anything to do with the number of cpu cores and so on however my local development workstation has 8 cores and it still runs once. So I'm not sure what else is going on. Have you experienced anything like this before with asp.net core hosted service?

            ...

            ANSWER

            Answered 2021-Jan-20 at 23:16

            It was because in IIS I had set the Max Worker Process to 5 for the API. Resetting it back to 1 fixed the issue

            Source https://stackoverflow.com/questions/65744225

            QUESTION

            Why performance test shows me that lists are much faster than arrays with my code?
            Asked 2021-Jan-03 at 14:34
            LIST FOR      00:00:00.0000980
            LIST FOREACH  00:00:00.0000007
            ARRAY FOR     00:00:00.0028450
            ARRAY FOREACH 00:00:00.0051233
            
            ...

            ANSWER

            Answered 2021-Jan-03 at 11:00

            Those tests are not comparable.

            This creates an array with a million entries.

            Source https://stackoverflow.com/questions/65548681

            QUESTION

            Two Timer Triggers on Azure Function With Params
            Asked 2020-Nov-03 at 14:39

            We have two timer triggers an Azure function - Trigger A and Trigger B. If Trigger A is defined "first", it runs and Trigger B doesn't. Likewise, if Trigger B is defined first, it runs and Trigger A does not.

            This leads to two questions:

            1. Can an Azure function have two timer triggers? I can't find anything in the documentation. Closest thing I found is a SO answer implying that this is impossible.
            2. What is a good solution to this problem given that comma-delimited NCRONTAB expression as per the official docs does not cut it here due to the different params?

            We are at a point where we are tempted to change the timer triggers to API triggers and have a redundant function app on a timer call the endpoint with different params.

            ...

            ANSWER

            Answered 2020-Nov-03 at 14:39

            Update:

            As Peter Bons mentioned, 'call a shared method'.

            Original Answer:

            Can an Azure function have two timer triggers? I can't find anything in the documentation. Closest thing I found is a SO answer implying that this is impossible.

            If you are talking about azure function app, then it is possiable.

            But if you are talking about single azure function, then you can not put two trigger in one function.

            For example, below works well:

            What is a good solution to this problem given that comma-delimited NCRONTAB expression as per the official docs does not cut it here due to the different params?

            CRON expressions cannot represent all use cases, so sometimes it is necessary to divide the code into two functions in a function app.

            If you want a 'dynamic' CRON, you can do something like below and change the ralated value:

            Source https://stackoverflow.com/questions/64664294

            QUESTION

            Azure Functions ncrontab value
            Asked 2020-Oct-20 at 00:35

            I just want you guys to double check to see if I'm getting this ncrontab expression right for my Azure Function.

            I'd like my function to run:

            • Monday through Friday
            • Every 30 minutes starting at the top of the hour
            • Starting at 9 AM
            • Ending at 6 PM

            As I understand it, there are six places in ncrontab Azure Functions use.

            They are: {second} {minute} {hour} {day} {month} {dayOfWeek}.

            Here's what I've come up with: 0 */30 9-18 * * 1-5

            Is my expression correct? A related question is do these values need to be UTC times?

            Here's the documentation: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=csharp

            ...

            ANSWER

            Answered 2020-Oct-20 at 00:35

            Yes, the expression is correct.

            For the questions about UTC times, The default time zone used with the CRON expressions is UTC. And you can change the time zone by creating an app setting for your function app named WEBSITE_TIME_ZONE. See here for more details.

            Source https://stackoverflow.com/questions/64436059

            QUESTION

            Azure functions NCRONTAB: Don´t trigger a timetrigger on saturdays
            Asked 2020-Sep-25 at 12:24

            Trying to set up a Timetrigger function and got stuck with the NCRONTAB-expression. How do i set up the expression so the function triggers every morning at 05.00 AM but not at saturdays. Is that possible?

            ...

            ANSWER

            Answered 2020-Sep-25 at 12:24

            The NCRONTAB expressions are based on this format:

            Source https://stackoverflow.com/questions/64063316

            QUESTION

            Azure Functions with NCrontab returning method not found message
            Asked 2020-Aug-25 at 12:58

            We are trying to use the NCrontab package to create a new Microsoft.Azure.WebJobs.Extensions.Timers.CronSchedule object instance. Using the following code:

            ...

            ANSWER

            Answered 2020-Aug-25 at 12:58

            QUESTION

            Schedule a timer-triggered Azure function from the Azure Portal
            Asked 2020-Jul-08 at 02:09

            I have an Azure Function (built in Visual Studio 2019, and running on the .NET Core 3.x stack in Azure) that is supposed to be triggered by a timer to run e.g. once per night.

            I can easily create the function and define the schedule as an NCRONTAB expression like this:

            ...

            ANSWER

            Answered 2020-Jul-08 at 02:09

            As the post provided by silent, we can use ConfigurationManager.AppSettings["key"]. But I think you can refer to the solution below which is more simple.

            1. Edit your function code in local, do not specify a cron expression in the code, use %myTimerCron% instead.

            2. Publish it from local to azure, and then add a key/value in the "Application settings".

            3. Then you can edit the cron expression by edit the value of myTimerCron in "Application settings" on azure portal.

            By the way, when you test the code in local in visual studio, you just need to provide a cron expression with the name of "myTimerCron" in "local.setting.json".

            Source https://stackoverflow.com/questions/62773585

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install NCrontab

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/atifaziz/NCrontab.git

          • CLI

            gh repo clone atifaziz/NCrontab

          • sshUrl

            git@github.com:atifaziz/NCrontab.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Cron Utils Libraries

            cron

            by robfig

            node-schedule

            by node-schedule

            agenda

            by agenda

            node-cron

            by kelektiv

            cron-expression

            by mtdowling

            Try Top Libraries by atifaziz

            LinqPadless

            by atifazizC#

            High5

            by atifazizHTML

            Fizzler

            by atifazizC#

            t5

            by atifazizC#

            Hazz

            by atifazizC#