How to tell if the current instance is the scheduler app

Vote:
 

I've a requirement to run some code on the scheduler app instance in DXC alongside our scheduled job, which creates and schedules jobs according to Azure Service Bus messages.

At the moment i'm trying to read the local machines 'hostname' and provide something in config that matches that hostname to let us know we are on the correct machine or not for starting our extra code. Problem i have is the hostname appears to be changing on each deploy, or at least isn't completely static

Is there a simple way to tell if scheduled jobs are enable in the current instance of EpiServer?

#230134
Oct 30, 2020 9:51
Vote:
 

Easiest way could be to look for the enableScheduler in the Episerver config?

https://world.episerver.com/documentation/developer-guides/CMS/configuration/Configuring-episerver/#applicationsettings 

#230135
Oct 30, 2020 12:01
Vote:
 

Thanks @David, i thought of that approach, but couldn't find a clear way to access those settings, as it's not <appSettings> but <applicationSettings> instead.

#230136
Oct 30, 2020 12:03
Vote:
 

Haven't tried myself, but Settings.Instance.EnableScheduler might work.

Or you can get the Settings instance by dependency injection, same thing. 

#230137
Oct 30, 2020 12:15
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.