Scheduled task

User avatar
ctd
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Scheduled task

Post by ctd »

Any chance you're doing this in VBA? I've noticed erratic/inconsistent behavior in macros I've written in the past and ultimately wasn't able to determine why, aside from the rationale that VBA was simply mischievous and tended to act out when I wasn't paying attention.



Perhaps try carrying out the process via a different paradigm or on a different machine?
User avatar
jungle
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Scheduled task

Post by jungle »

Thanks for the replies.



Tradenator: I've already checked - it's not an issue with power saving settings.



CTD: code is in C#.
it's axiomatic, deal with it.
User avatar
Hansi
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Scheduled task

Post by Hansi »

Had a similar issue with a server running Win 2003. Code was in C# and the thread was set to sleep for x hours selectable by user. For some fucked up reason the server didn't define seconds from the C# code as 1000ms but as 770ms (used another app to clock it) so I wound up using Thread.Sleep(770 * 60 * 60 * hours). 1000ms worked fine on another server. Never found out what caused it because my boss just told IT to wipe the server and set it up fresh and then it worked fine.
User avatar
aix
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Scheduled task

Post by aix »

> Other times it starts late and doesn't run ok, i.e. the task never completes.



You're suggesting that "starts late" and "never competes" are related.



By "never completes", do you mean it dies or hangs?



If the latter, I'd try attaching a debugger to the hung process to figure out its state. This might shed some light on what's going on.



In either case, I'd add logging throughout the task to see if I can figure out how far it gets on those occasions when there's a problem.
User avatar
aix
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Scheduled task

Post by aix »

Also, do the executable or any dependencies (DLLs etc) live on a network share?
User avatar
jungle
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Scheduled task

Post by jungle »

By "never completes", I mean "hangs".  I suspect that detailed debugging is probably the answer, though I was hoping I might be able to avoid that.



There are no DLLs on a network share, all of them are local.
it's axiomatic, deal with it.
User avatar
jungle
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Scheduled task

Post by jungle »

Update: running Scheduled Tasks when the PC has just been restarted (but I haven't logged in) seems to cause problems.  There is obviously a quick 'n' easy workaround here!
it's axiomatic, deal with it.
User avatar
aix
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Scheduled task

Post by aix »

Is the Windows account under which the task is scheduled to run permissioned to Log on as batch job?
Post Reply