-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a624dfe
commit 6007941
Showing
17 changed files
with
483 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
language: csharp | ||
mono: none | ||
dotnet: 5.0 | ||
dotnet: 7.0 | ||
dist: xenial | ||
env: | ||
global: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
using System; | ||
|
||
namespace Webenable.Hangfire.Contrib | ||
namespace Webenable.Hangfire.Contrib; | ||
|
||
/// <summary> | ||
/// Specifies that the job should be automatically scheduled in Hangfire | ||
/// using the specified <see cref="MethodName"/> and <see cref="CronExpression"/>. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] | ||
public class AutoScheduleAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Specifies that the job should be automatically scheduled in Hangfire | ||
/// using the specified <see cref="MethodName"/> and <see cref="CronExpression"/>. | ||
/// using the specified <paramref name="methodName"/> and <paramref name="cronExpression"/>. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] | ||
public class AutoScheduleAttribute : Attribute | ||
/// <param name="methodName">The name of the method to invoke the job with.</param> | ||
/// <param name="cronExpression">The CRON expression to schedule the job with.</param> | ||
public AutoScheduleAttribute(string methodName, string cronExpression) | ||
{ | ||
/// <summary> | ||
/// Specifies that the job should be automatically scheduled in Hangfire | ||
/// using the specified <paramref name="methodName"/> and <paramref name="cronExpression"/>. | ||
/// </summary> | ||
/// <param name="methodName">The name of the method to invoke the job with.</param> | ||
/// <param name="cronExpression">The CRON expression to schedule the job with.</param> | ||
public AutoScheduleAttribute(string methodName, string cronExpression) | ||
{ | ||
MethodName = methodName; | ||
CronExpression = cronExpression; | ||
} | ||
MethodName = methodName; | ||
CronExpression = cronExpression; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the name of the method to invoke the job with. | ||
/// </summary> | ||
public string MethodName { get; } | ||
/// <summary> | ||
/// Gets the name of the method to invoke the job with. | ||
/// </summary> | ||
public string MethodName { get; } | ||
|
||
/// <summary> | ||
/// Gets the CRON expression to schedule the job with. | ||
/// </summary> | ||
public string CronExpression { get; } | ||
} | ||
/// <summary> | ||
/// Gets the CRON expression to schedule the job with. | ||
/// </summary> | ||
public string CronExpression { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,37 @@ | ||
namespace Webenable.Hangfire.Contrib | ||
namespace Webenable.Hangfire.Contrib; | ||
|
||
/// <summary> | ||
/// Contains constant CRON expressions for convenience use in <see cref="AutoScheduleAttribute"/>. | ||
/// </summary> | ||
public static class Crons | ||
{ | ||
/// <summary> | ||
/// Contains constant CRON expressions for convenience use in <see cref="AutoScheduleAttribute"/>. | ||
/// Every minute. | ||
/// </summary> | ||
public static class Crons | ||
{ | ||
/// <summary> | ||
/// Every minute. | ||
/// </summary> | ||
public const string Minutely = "* * * * *"; | ||
public const string Minutely = "* * * * *"; | ||
|
||
/// <summary> | ||
/// Every hour. | ||
/// </summary> | ||
public const string Hourly = "0 * * * *"; | ||
/// <summary> | ||
/// Every hour. | ||
/// </summary> | ||
public const string Hourly = "0 * * * *"; | ||
|
||
/// <summary> | ||
/// Every day at 00:00. | ||
/// </summary> | ||
public const string Daily = "0 0 * * *"; | ||
/// <summary> | ||
/// Every day at 00:00. | ||
/// </summary> | ||
public const string Daily = "0 0 * * *"; | ||
|
||
/// <summary> | ||
/// Every Monday at 00:00. | ||
/// </summary> | ||
public const string Weekly = "0 0 * * 1"; | ||
/// <summary> | ||
/// Every Monday at 00:00. | ||
/// </summary> | ||
public const string Weekly = "0 0 * * 1"; | ||
|
||
/// <summary> | ||
/// Every first day of the month at 00:00. | ||
/// </summary> | ||
public const string Monthly = "0 0 1 * *"; | ||
/// <summary> | ||
/// Every first day of the month at 00:00. | ||
/// </summary> | ||
public const string Monthly = "0 0 1 * *"; | ||
|
||
/// <summary> | ||
/// Every year on January 1st at 00:00. | ||
/// </summary> | ||
public const string Yearly = "0 0 1 1 *"; | ||
} | ||
/// <summary> | ||
/// Every year on January 1st at 00:00. | ||
/// </summary> | ||
public const string Yearly = "0 0 1 1 *"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.