Example #1
0
        public SiteListenerService(SigRClient relay, ScriptTimer timer)
        {
            InitializeComponent();

            _relay      = relay;
            _timer      = timer;
            ServiceName = GetType().Assembly.GetCustomAttribute <AssemblyTitleAttribute>().Title;

            CanShutdown = true;
            CanStop     = true;
        }
Example #2
0
        private static void InitTimers(RemoteSite site)
        {
            //setup timers
            var scripts = new List <ScriptObject>();

            if (site.SiteType == SiteTypes.MasterHQ)
            {
                scripts.Add(new ScriptObject("sync-ad.ps1"));
                scripts.Add(new ScriptObject("sync-b2b.ps1"));
            }
            else
            {
                scripts.Add(new ScriptObject("sync.ps1"));
            }

            ScriptTimer.ScriptFolderPath = _scriptFolderPath;

            timer               = new ScriptTimer(scripts.ToArray(), _timerIntervalMinutes);
            timer.ErrorEvent   += Timer_ErrorEvent;
            timer.StatusUpdate += Timer_StatusUpdate;
        }
Example #3
0
 private static void Relay_FireScriptEvent(object sender, FireScriptEvent e)
 {
     ScriptTimer.RunScript(e.Script);
 }