Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2006

Tip: Looking for answers? Try searching our database.

System.Timers.Timer and slick way to skip processing at configurable times

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
josh - 05 Jan 2006 01:19 GMT
Hello,

I have written a Windows Service that checks ODBC connectivity to a
legacy ODBC source on a specified interval (15 minutes for example).
If unexpected downtime are encountered, I log an event to the event
viewer and email IT of this unexpected downtime.  The settings for the
windows service are configured in the app.config but they could just as
easily be set in the registry.

I am looking for advise on how enable an easy way to configure known
"periods of downtime" where the Elapsed event can check to see if the
service is about to fire the EventHandler during one of these
configured "downtimes" and skip firing the event until it checks again
for the next interval.

For example, if the service runs all the time, and I know that our ODBC
source is down for 30 minutes starting at 10:00 AM, I want to prevent
the EventHandler of the Elapsed event from running it's test and
logging/sending unnecessary error messages.

I'd like to be able to add 0 to many downtimes to the service to
prevent these known downtime messages from being logged/sent.

I've looked at 2 different methods so far but figured there must be a
more elegant way:

1) Add appSettings "Downtime1...DowntimeN" with corresponding
"TimeSpans1...n"
2) Adding a custom IConfigurationSectionHandler to handle this, but I'm
a bit fuzzy on how to accomplish this.

Here are some examples of possible downtimes:

10:00 AM - 10:30 AM (down for quick morning backup)
9:00 PM - 3:00 AM (down for night processing)
etc.

Any advise is appreciated.

Thanks,

Josh Blair
Marina - 05 Jan 2006 19:30 GMT
I think this should be in a data source that is easy for someone to update,
and easy for the application to read. An XML file, an access database, etc

> Hello,
>
[quoted text clipped - 38 lines]
>
> Josh Blair
joshblair - 05 Jan 2006 19:51 GMT

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.