Hi,
I have the following situation in our Studio:
We have two repositories. On each is the same job (one is transferred to the other). The original job (lets call it place holder) is blacklisted with all slaves and will just represent the transferred render job in the other repository. I wrote an application plugin (update job) which is only updating the render progress to the place holder job. That works fine, but the update job is running the whole time. My idea is to change the schedule time each time when the job itself is running. So when the update job runs, it changes its schedule start time to X minutes in the future. The problem is that it looks like that I can’t change the job properties in the plugin itself.
Example:
Job = self.GetJob()
Job.JobScheduledType="Once"
self.LogInfo(Job.JobScheduledType) # <- Check it
The system print was right and it the job schedule type is changed, but when I check the result with the job properties in the Deadline Monitor nothing was changed. Why can’t I change the Schedule stuff inside the plugin?
I also want to change schedule start date time. The object property Job.JobScheduledStartDateTime is expecting an object called DateTime and is from type <class ‘System.DateTime’>, but i can’t find any information in the documentation to convert my date into this object (The class System is not documented).
I also tried to set the property with a string in the expected format y/m/d H:M:S, but it doens’t work:
import datetime
interval = int(self.GetConfigEntryWithDefault( "RepeatInterval", str(2) ))
newTime = datetime.datetime.now() + datetime.timedelta(minutes=interval)
Job.JobScheduledStartDateTime = newTime.strftime("%Y/%m/%d %H:%M:%S")
The following Error appears:
[code]Error in RenderTasks: TypeError : ‘str’ value cannot be converted to System.DateTime (Python.Runtime.PythonException)
File “none”, line 96, in RenderTasks
at Deadline.Plugins.ScriptPlugin.RenderTasks(String taskId, Int32 startFrame, Int32 endFrame, String& outMessage, AbortLevel& abortLevel)
[/code]
How do I convert my time into the expected format? Or is there a better way to let a job pause for a defined time, after it was running?
Thanks,
Michael