-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: auto create scheluded task, fixed to be able to execute on non-…
…Azure SQL Servers.
- Loading branch information
Airam Hernández Hernández
committed
Jul 21, 2023
1 parent
d62b9a6
commit b28fe44
Showing
8 changed files
with
90 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using DotNetNuke.Entities.Modules; | ||
using DotNetNuke.Services.Scheduling; | ||
using System; | ||
using System.Linq; | ||
|
||
namespace Intelequia.Modules.DNNPulse.Components | ||
{ | ||
public class FeatureController : IUpgradeable | ||
{ | ||
public string UpgradeModule(string version) | ||
{ | ||
try | ||
{ | ||
var task = DotNetNuke.Services.Scheduling.SchedulingController.GetSchedule().FirstOrDefault(x => x.TypeFullName == "Intelequia.Modules.DNNPulse.Tasks.PulseTask, DNNPulse"); | ||
if (task != null) | ||
{ | ||
SchedulingController.DeleteSchedule(task.ScheduleID); | ||
} | ||
|
||
string fullName = "Intelequia.Modules.DNNPulse.Tasks.PulseTask, DNNPulse"; | ||
var startTime = DateTime.Now; | ||
var timeLapse = 1; | ||
var timeLapseMeasurement = "d"; | ||
var retryTimeLapse = 30; | ||
var retryTimeLapseMeasurement = "m"; | ||
var retainHistoryNum = 0; | ||
var attatchToEvent = ""; | ||
var catchUpEnable = false; | ||
var enable = true; | ||
var objectDependency = ""; | ||
var servers = ""; | ||
var friendlyName = "DNN Pulse"; | ||
// Add the scheduled task | ||
SchedulingController.AddSchedule( | ||
fullName, timeLapse, timeLapseMeasurement, retryTimeLapse, retryTimeLapseMeasurement, retainHistoryNum, attatchToEvent, catchUpEnable, enable, objectDependency, servers, friendlyName, startTime); | ||
|
||
return "Success"; | ||
} | ||
catch (Exception ex) | ||
{ | ||
return "Failed: " + ex.Message; | ||
} | ||
} | ||
|
||
} | ||
} |
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
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
*/ | ||
|
||
using DotNetNuke.Framework; | ||
|
||
using System; | ||
|
||
namespace Intelequia.Modules.DNNPulse.Data | ||
{ | ||
|
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
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