the best way to do that, resuming thread after conisderable amount of time

  • Thread starter Thread starter LP
  • Start date Start date
L

LP

Hi,
I developed a console application that is currently in production. It is
scheduled to run every morning (very early morning), to move files from one
server to another, update SQL db and then ftp files to a remote server.
Everything is great, but remote ftp server people, want to begin excepting
files after 9am our time, when this console app begins to run like at 3am. I
can't reschedule the app, because data needs to be in SQL before office
hours (way before 9am) I don't want to write or schedule another app either
just to ftp files . Thus the dilemma.
I am thinking suspending the thread and resuming it hours later to finish
ftp files. I have a feeling that it's a bad idea, but I can't say exactly
way. What's the best way of handling it?
 
LP said:
I developed a console application that is currently in production. It is
scheduled to run every morning (very early morning), to move files from one
server to another, update SQL db and then ftp files to a remote server.
Everything is great, but remote ftp server people, want to begin excepting
files after 9am our time, when this console app begins to run like at 3am. I
can't reschedule the app, because data needs to be in SQL before office
hours (way before 9am) I don't want to write or schedule another app either
just to ftp files . Thus the dilemma.
I am thinking suspending the thread and resuming it hours later to finish
ftp files. I have a feeling that it's a bad idea, but I can't say exactly
way. What's the best way of handling it?

Call Thread.Sleep? You might want to call it repeatedly, pausing for
five minutes at a time and checking whether or not it's time to do the
FTP part. That way you'll notice if the clock changes.
 
Back
Top