Shedules fix
This commit is contained in:
parent
645229bef1
commit
476f7a2b19
7 changed files with 461 additions and 542 deletions
|
@ -6,14 +6,16 @@ namespace WebsitePanel.SchedulerService
|
|||
{
|
||||
public partial class SchedulerService : ServiceBase
|
||||
{
|
||||
private Timer _timer = new Timer(Process, null, 5000, 5000);
|
||||
|
||||
private Timer _Timer;
|
||||
private static bool _isRuninng;
|
||||
#region Construcor
|
||||
|
||||
public SchedulerService()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_Timer = new Timer(Process, null, 5000, 5000);
|
||||
_isRuninng = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -22,12 +24,17 @@ namespace WebsitePanel.SchedulerService
|
|||
|
||||
protected override void OnStart(string[] args)
|
||||
{
|
||||
Scheduler.Start();
|
||||
}
|
||||
|
||||
protected static void Process(object callback)
|
||||
{
|
||||
Scheduler.Start();
|
||||
//check running service
|
||||
if (_isRuninng)
|
||||
return;
|
||||
|
||||
_isRuninng = true;
|
||||
Scheduler.Start();
|
||||
_isRuninng = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue