Slowing down flows
I have a flow that takes in XML files and processes them, however I'm dumping in 50-100 files at a time. When this happens, the script I'm using gets choked up and outputs incorrect data - I just need to slow it down. Is there a method to release a file every 10 seconds or something like that?
Yeah I don't think hold jobs is smart enough to let them go sequentially.
Perhaps if you had a release condition being a completed job returning and releasing a previous one. But what would release the first job?
This would be easy if you could have a connector determine a location based on the number of jobs in the following folder. Like, send a file from folder a to folder b, if folder_b.count == 0. But I don't think you can do that outside of a script.
What about a simple script that had a setTimeout of a few seconds? I think the way Switch works. That seems like it would work if every file needed to pass through it and Switch launched only one instance of your script per flow -- not sure if that is the case but I know only a single instance of the SmartStream VDP configurator can run at a time, so maybe.
Perhaps if you had a release condition being a completed job returning and releasing a previous one. But what would release the first job?
This would be easy if you could have a connector determine a location based on the number of jobs in the following folder. Like, send a file from folder a to folder b, if folder_b.count == 0. But I don't think you can do that outside of a script.
What about a simple script that had a setTimeout of a few seconds? I think the way Switch works. That seems like it would work if every file needed to pass through it and Switch launched only one instance of your script per flow -- not sure if that is the case but I know only a single instance of the SmartStream VDP configurator can run at a time, so maybe.
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
-
ArielRauch
- Advanced member
- Posts: 230
- Joined: Thu Aug 07, 2014 10:04 am
I am not in front of switch right no but you can decide whether your script runs serialized or may work parallel for different instances.
Have you tried to play with this?
Have you tried to play with this?
-
ArielRauch
- Advanced member
- Posts: 230
- Joined: Thu Aug 07, 2014 10:04 am
another approach would be to build a kind of semaphore with global data
In the properties of the script in Switch Scripter you can set whether it executes concurrently or serialized. It seems the choice for you is to set this to "Serialized".
I do not know what the script does, but if it stays within the confines of Switch internal stuff (no Process.execute, no temporary files) I find it odd that the execution of the script should yield different results depending on how many files there are in the input folder. So I do not want to jump to conclusions, but I do not rule out a programming error.
Freddy
I do not know what the script does, but if it stays within the confines of Switch internal stuff (no Process.execute, no temporary files) I find it odd that the execution of the script should yield different results depending on how many files there are in the input folder. So I do not want to jump to conclusions, but I do not rule out a programming error.
Freddy
freddyp wrote: In the properties of the script in Switch Scripter you can set whether it executes concurrently or serialized. It seems the choice for you is to set this to "Serialized".
ArielRauch wrote: you can decide whether your script runs serialized or may work parallel for different instances.
Very good to know. Thanks
ArielRauch wrote: you can decide whether your script runs serialized or may work parallel for different instances.
Very good to know. Thanks
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
-
dkelly
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
Here's a script that implements simple and reliable "hold job" where you specify how many jobs to release every N minutes.
https://www.dropbox.com/s/zb7i6iy8cn9n2 ... cript?dl=0
Dwight Kelly
Apago, Inc.
For all of your Switch flow and scripting development needs
https://www.dropbox.com/s/zb7i6iy8cn9n2 ... cript?dl=0
Dwight Kelly
Apago, Inc.
For all of your Switch flow and scripting development needs
dkelly,
Thanks for that script! After some research I realized it was a command line element that was jamming things up because it was set to concurrent - switching it to serialized cured the problem...
But I have another flow where this Hold script will be useful...
Thanks for that script! After some research I realized it was a command line element that was jamming things up because it was set to concurrent - switching it to serialized cured the problem...
But I have another flow where this Hold script will be useful...