Hangfire Recurring Job

This commit is contained in:
Sedat Öztürk 2026-05-15 23:47:52 +03:00
parent 9afa9edb98
commit efdba93e32
7 changed files with 51 additions and 49 deletions

View file

@ -1833,15 +1833,15 @@
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "App.BackgroundWorkers.Definitions", "key": "App.BackgroundWorkers.RecurringJobs",
"en": "Background Worker Definitions", "en": "Recurring Jobs",
"tr": "Arkaplan İşleri Tanımları" "tr": "Tekrarlayan İşler"
}, },
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "App.BackgroundWorkers.JobFlow", "key": "App.BackgroundWorkers.Jobs",
"en": "Background Worker Job Flow", "en": "Jobs",
"tr": "Arkaplan İşleri İş Akışı" "tr": "İşler"
}, },
{ {

View file

@ -4719,8 +4719,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
} }
#endregion #endregion
#region Background Worker #region Background Worker Recurring Jobs
listFormName = AppCodes.BackgroundWorkers.Definitions; listFormName = AppCodes.BackgroundWorkers.RecurringJobs;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{ {
var listForm = await _listFormRepository.InsertAsync( var listForm = await _listFormRepository.InsertAsync(
@ -4957,8 +4957,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
} }
#endregion #endregion
#region Background Worker Job Flow #region Background Worker Jobs
listFormName = AppCodes.BackgroundWorkers.JobFlow; listFormName = AppCodes.BackgroundWorkers.Jobs;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{ {
var listForm = await _listFormRepository.InsertAsync( var listForm = await _listFormRepository.InsertAsync(

View file

@ -691,22 +691,22 @@
}, },
{ {
"ParentCode": "App.BackgroundWorkers", "ParentCode": "App.BackgroundWorkers",
"Code": "App.BackgroundWorkers.Definitions", "Code": "App.BackgroundWorkers.RecurringJobs",
"DisplayName": "App.BackgroundWorkers.Definitions", "DisplayName": "App.BackgroundWorkers.RecurringJobs",
"Order": 1, "Order": 1,
"Url": "/admin/list/App.BackgroundWorkers.Definitions", "Url": "/admin/list/App.BackgroundWorkers.RecurringJobs",
"Icon": "FcDataConfiguration", "Icon": "FcDataConfiguration",
"RequiredPermissionName": "App.BackgroundWorkers.Definitions", "RequiredPermissionName": "App.BackgroundWorkers.RecurringJobs",
"IsDisabled": false "IsDisabled": false
}, },
{ {
"ParentCode": "App.BackgroundWorkers", "ParentCode": "App.BackgroundWorkers",
"Code": "App.BackgroundWorkers.JobFlow", "Code": "App.BackgroundWorkers.Jobs",
"DisplayName": "App.BackgroundWorkers.JobFlow", "DisplayName": "App.BackgroundWorkers.Jobs",
"Order": 2, "Order": 2,
"Url": "/admin/list/App.BackgroundWorkers.JobFlow", "Url": "/admin/list/App.BackgroundWorkers.Jobs",
"Icon": "FcFlowChart", "Icon": "FcFlowChart",
"RequiredPermissionName": "App.BackgroundWorkers.JobFlow", "RequiredPermissionName": "App.BackgroundWorkers.Jobs",
"IsDisabled": false "IsDisabled": false
}, },
{ {

View file

@ -1364,17 +1364,17 @@
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.Definitions", "Name": "App.BackgroundWorkers.RecurringJobs",
"ParentName": null, "ParentName": null,
"DisplayName": "App.BackgroundWorkers.Definitions", "DisplayName": "App.BackgroundWorkers.RecurringJobs",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
"MenuGroup": "Erp|Kurs" "MenuGroup": "Erp|Kurs"
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.Definitions.Create", "Name": "App.BackgroundWorkers.RecurringJobs.Create",
"ParentName": "App.BackgroundWorkers.Definitions", "ParentName": "App.BackgroundWorkers.RecurringJobs",
"DisplayName": "Create", "DisplayName": "Create",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
@ -1382,8 +1382,8 @@
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.Definitions.Delete", "Name": "App.BackgroundWorkers.RecurringJobs.Delete",
"ParentName": "App.BackgroundWorkers.Definitions", "ParentName": "App.BackgroundWorkers.RecurringJobs",
"DisplayName": "Delete", "DisplayName": "Delete",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
@ -1391,8 +1391,8 @@
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.Definitions.Export", "Name": "App.BackgroundWorkers.RecurringJobs.Export",
"ParentName": "App.BackgroundWorkers.Definitions", "ParentName": "App.BackgroundWorkers.RecurringJobs",
"DisplayName": "Export", "DisplayName": "Export",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
@ -1400,8 +1400,8 @@
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.Definitions.Import", "Name": "App.BackgroundWorkers.RecurringJobs.Import",
"ParentName": "App.BackgroundWorkers.Definitions", "ParentName": "App.BackgroundWorkers.RecurringJobs",
"DisplayName": "Import", "DisplayName": "Import",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
@ -1409,8 +1409,8 @@
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.Definitions.Update", "Name": "App.BackgroundWorkers.RecurringJobs.Update",
"ParentName": "App.BackgroundWorkers.Definitions", "ParentName": "App.BackgroundWorkers.RecurringJobs",
"DisplayName": "Update", "DisplayName": "Update",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
@ -1419,17 +1419,17 @@
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.JobFlow", "Name": "App.BackgroundWorkers.Jobs",
"ParentName": null, "ParentName": null,
"DisplayName": "App.BackgroundWorkers.JobFlow", "DisplayName": "App.BackgroundWorkers.Jobs",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
"MenuGroup": "Erp|Kurs" "MenuGroup": "Erp|Kurs"
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.JobFlow.Create", "Name": "App.BackgroundWorkers.Jobs.Create",
"ParentName": "App.BackgroundWorkers.JobFlow", "ParentName": "App.BackgroundWorkers.Jobs",
"DisplayName": "Create", "DisplayName": "Create",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
@ -1437,8 +1437,8 @@
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.JobFlow.Delete", "Name": "App.BackgroundWorkers.Jobs.Delete",
"ParentName": "App.BackgroundWorkers.JobFlow", "ParentName": "App.BackgroundWorkers.Jobs",
"DisplayName": "Delete", "DisplayName": "Delete",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
@ -1446,8 +1446,8 @@
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.JobFlow.Export", "Name": "App.BackgroundWorkers.Jobs.Export",
"ParentName": "App.BackgroundWorkers.JobFlow", "ParentName": "App.BackgroundWorkers.Jobs",
"DisplayName": "Export", "DisplayName": "Export",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
@ -1455,8 +1455,8 @@
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.JobFlow.Import", "Name": "App.BackgroundWorkers.Jobs.Import",
"ParentName": "App.BackgroundWorkers.JobFlow", "ParentName": "App.BackgroundWorkers.Jobs",
"DisplayName": "Import", "DisplayName": "Import",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,
@ -1464,8 +1464,8 @@
}, },
{ {
"GroupName": "App.Saas", "GroupName": "App.Saas",
"Name": "App.BackgroundWorkers.JobFlow.Update", "Name": "App.BackgroundWorkers.Jobs.Update",
"ParentName": "App.BackgroundWorkers.JobFlow", "ParentName": "App.BackgroundWorkers.Jobs",
"DisplayName": "Update", "DisplayName": "Update",
"IsEnabled": true, "IsEnabled": true,
"MultiTenancySide": 2, "MultiTenancySide": 2,

View file

@ -103,17 +103,19 @@ public class SqlDataSeeder : IDataSeedContributor, ITransientDependency
var patterns = new[] var patterns = new[]
{ {
(@"CREATE\s+TABLE\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE", "TABLE"), (@"CREATE\s+TABLE\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE", "TABLE"),
(@"ALTER\s+TABLE\s+(\[?\w+\]?\.?\[?\w+\]?)", "ALTER", "TABLE"),
(@"CREATE\s+VIEW\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE", "VIEW"), (@"CREATE\s+VIEW\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE", "VIEW"),
(@"CREATE\s+PROCEDURE\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE", "PROCEDURE"), (@"CREATE\s+PROCEDURE\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE", "PROCEDURE"),
(@"ALTER\s+PROCEDURE\s+(\[?\w+\]?\.?\[?\w+\]?)", "ALTER", "PROCEDURE"),
(@"CREATE\s+OR\s+ALTER\s+PROCEDURE\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE/ALTER", "PROCEDURE"),
(@"CREATE\s+FUNCTION\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE", "FUNCTION"), (@"CREATE\s+FUNCTION\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE", "FUNCTION"),
(@"ALTER\s+TABLE\s+(\[?\w+\]?\.?\[?\w+\]?)", "ALTER", "TABLE"),
(@"ALTER\s+VIEW\s+(\[?\w+\]?\.?\[?\w+\]?)", "ALTER", "VIEW"),
(@"ALTER\s+PROCEDURE\s+(\[?\w+\]?\.?\[?\w+\]?)", "ALTER", "PROCEDURE"),
(@"ALTER\s+FUNCTION\s+(\[?\w+\]?\.?\[?\w+\]?)", "ALTER", "FUNCTION"),
(@"CREATE\s+(UNIQUE\s+)?INDEX\s+(\[?\w+\]?)", "CREATE", "INDEX"), (@"CREATE\s+(UNIQUE\s+)?INDEX\s+(\[?\w+\]?)", "CREATE", "INDEX"),
(@"CREATE\s+TRIGGER\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE", "TRIGGER"), (@"CREATE\s+TRIGGER\s+(\[?\w+\]?\.?\[?\w+\]?)", "CREATE", "TRIGGER"),
(@"DROP\s+TABLE\s+(\[?\w+\]?\.?\[?\w+\]?)", "DROP", "TABLE"), (@"DROP\s+TABLE\s+(\[?\w+\]?\.?\[?\w+\]?)", "DROP", "TABLE"),
(@"DROP\s+VIEW\s+(\[?\w+\]?\.?\[?\w+\]?)", "DROP", "VIEW"), (@"DROP\s+VIEW\s+(\[?\w+\]?\.?\[?\w+\]?)", "DROP", "VIEW"),
(@"DROP\s+PROCEDURE\s+(\[?\w+\]?\.?\[?\w+\]?)", "DROP", "PROCEDURE"), (@"DROP\s+PROCEDURE\s+(\[?\w+\]?\.?\[?\w+\]?)", "DROP", "PROCEDURE"),
(@"DROP\s+FUNCTION\s+(\[?\w+\]?\.?\[?\w+\]?)", "DROP", "FUNCTION"),
}; };
foreach (var (pattern, action, type) in patterns) foreach (var (pattern, action, type) in patterns)

View file

@ -436,8 +436,8 @@ public static class PlatformConsts
{ {
public const string Default = Prefix.App + ".BackgroundWorkers"; public const string Default = Prefix.App + ".BackgroundWorkers";
public const string Definitions = Default + ".Definitions"; public const string RecurringJobs = Default + ".RecurringJobs";
public const string JobFlow = Default + ".JobFlow"; public const string Jobs = Default + ".Jobs";
} }
public static class Menus public static class Menus

View file

@ -408,8 +408,8 @@ public static class SeedConsts
{ {
public const string Default = Prefix.App + ".BackgroundWorkers"; public const string Default = Prefix.App + ".BackgroundWorkers";
public const string Definitions = Default + ".Definitions"; public const string RecurringJobs = Default + ".RecurringJobs";
public const string JobFlow = Default + ".JobFlow"; public const string Jobs = Default + ".Jobs";
} }
//Web Site //Web Site