Launchd starting a new process

launchd

I currently have a process that is running some shell scripts that then a call to an API. When it makes the calls, there might be like 10-15 seconds when the script is waiting for the external API to send a response. This is when I notice that the process is run again. So it will get to that point and then run another process for that. Is there any way for me to prevent this from happening? I need to run this process every 30 minutes.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>com.leads.issues</string>
<key>LingonWhat</key>
<string>/Users/Marketing/Desktop/TrueLeadsUpdate.app/Contents/MacOS/applet</string>
<key>ProgramArguments</key>
<array>
    <string>/Users/Marketing/Desktop/TrueLeadsUpdate.app/Contents/MacOS/applet</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>1800</integer>

Best Answer

Have you tried adding a an ExitTimeOut key? From man launchd.plist:

ExitTimeOut <integer>
The amount of time launchd waits before sending a SIGKILL signal. The default value
is 20 seconds. The value zero is interpreted as infinity.