Hi David,
How/when are you killing the worker. You must give the worker time to
close the file. This will not work…
CALL WORKER(“worker”;”LogSomething”) //worker opens the file/logs something to
the file/closes the file
KILL WORKER(“worker”)
The worker will be killed before it closes the file.
This will work…
CALL WORKER(“worker”;”LogSomething”) //worker opens the file/logs something to
the file/closes the file
DELAY PROCESS(Current Process;10) //or more if it takes longer than 10 ticks to
open and close the file
KILL WORKER(“worker”)
When I tested this at first I used a Repeat loop to make sure that the
file was closed. I then found that a DELAY PROCESS worked just as well…
CALL WORKER(“worker”;”LogSomething”) //worker opens the file/logs something to
the file/closes the file
$onErrCall:=Method called on error
ON ERR CALL("ExpectedError")
Repeat
vError:=False
$docRef:=Open document($file)
If (Not(vError))
CLOSE DOCUMENT($docRef)
End if
Until (Not(vError))
ON ERR CALL($onErrCall)
KILL WORKER(“worker”)
EVEN BETTER! I just thought, why not have the worker kill itself? Wow!
just test and it works!
CALL WORKER(“worker”;”LogSomething”) //worker opens the file/logs something to
the file/closes the file/Kills itself
KILL WORKER(“worker”)
//worker method
$docRef:=Open document($file)
//record the event or whatever
CLOSE DOCUMENT($docRef)
KILL WORKER("worker")
Does this work for you?
John
> On Oct 6, 2017, at 12:02 PM, David Adams via 4D_Tech <[email protected]>
> wrote:
>
> Again:
>
> Start worker
> Open file.
> Use file
> Close file.
> Kill worker
>
> Start worker again
> *** FIle lock conflict ***
>
> 4D's accepted it as a bug as of some months back.
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ: http://lists.4d.com/faqnug.html
> Archive: http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub: mailto:[email protected]
> **********************************************************************
John Baughman
Kailua, Hawaii
(808) 262-0328
[email protected]
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************