I have never had an issue with DELAY PROCESS. Maybe I'm lucky. I don't
think I've ever used it to delay something more than a matter of seconds,
though. It would never have occurred to me to DELAY PROCESS for minutes or
hours.

If I have some process I only want one instance of, maybe processing
records created by imports from various, simultaneous sources, I use this
outline:

// UniqueProcessMethod (some parameter)
$processName:=Current method name
Case of

:(Count parameters=1)

$pid:=Process number($processName)

If($pid=0)  // process doesn't exist

$pid:=EXECUTE ON SERVER(Current method name; 1024*1024; $processName;
$1;Current process)

End if

:(Count parameters=2)

//  do whatever here

End case


This works consistently if called from a client process or server process.
I prefer making $1 an object but the approach works just as well if you
have more than one parameter. The key is adding the current process
(sometimes useful) to distinguish between the call to start the process and
just checking data.

The other tool I have for such situations is a really simple stored method
launcher. It requires 1 table, a background loop (which delays 1 minute)
and the idea is to create a record for each method that I want to run at
some interval. I'm sure a lot of you already have such a thing in place.
This is what I use in place of long delays. Like for daily reports or
maintenance methods.

On Fri, Jun 15, 2018 at 12:04 AM Bernd Fröhlich via 4D_Tech <
[email protected]> wrote:

> Bryan Green:
>
> > Actually, that's exactly what I meant -- short-term (5 minutes, 10
> minutes, etc.) kind of delay using DELAY PROCESS is more stable than
> something like 12 hours, 1 day, etc. using DELAY PROCESS.
>
> If by "more stable" you mean "hangs only every few weeks" that may be
> right.
> I still would not use it at the moment.
> Until it stopped beeing reliable I used it to delay a process by 10
> seconds.
>
> Greetings from Germany,
> Bernd Fröhlich
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************



-- 
Kirk Brooks
San Francisco, CA
=======================

*We go vote - they go home*
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to