Need some help with my logic here - just want to make sure I'm not overlooking anything...
I have a service that when it's first launched (or more precisely 10 seconds later), it begins testing for the presence of a file.
If the file exists, it begins the copy and extraction process, which takes about 10-15 minutes (the file will vary slightly on a daily basis, so this is a rough range).
If the file isn't there, the test occurs (setting the timer interval) every 10 minutes until it is there.
Sadly, the file is never created at the same point - it varies by an hour or two (or more - and possibly not at all).
Once the copy process is successful, I set the timer interval to 20 hours to await the next generation, at which point the timer is then set to 10 minutes until it's found again.
Lastly, if the timer tick ever occurs on a weekend day, I reset the interval to 24 hours and wait until the following business day to try again.
That said, I'd like some suggestions/corrections in case I've set this up incorrectly...here's the sub:
Shared Sub tmr_Tick(ByVal source As Object, ByVal e As Timers.ElapsedEventArgs)
If blnCopyInProgress Then
Select Case Today.DayOfWeek
Case DayOfWeek.Saturday Or DayOfWeek.Sunday
tmr.Interval = 86400000 'delay 24 hours
'other logging code here
If tmr.Interval <> 600000 Then tmr.Interval = 600000
If File.Exists(strSrcFile) Then
tmr.Interval = 72000000 ' wait 20 hours before trying again