-
1. Re: CF8 DirectoryWatcher Gateway Doesn't Run When I Overwrite a File
molaro May 15, 2009 7:40 AM (in response to molaro)Ok, I now know what's happening in ISSUE 2, where only 11 files uploaded at a time. In the CFAdmin I can set the nu,ber of threads to dedicate to the Event Gateway, and then the max number of requests to queue. The defaults ar 1 thread and 10 queue requests (my 11 files). So I will set it higher. Is there a danger limite with the threads or the request queue I should avoid? If I set up 5 threads and 200 requests does that sound safe in general (I'm sure it depends on my server specs).
-
2. Re: CF8 DirectoryWatcher Gateway Doesn't Run When I Overwrite a File
BKBK May 24, 2009 10:25 AM (in response to molaro)I would in any case code all 3 methods, onAdd, onChange and onDelete, and include the cflog tag in each to identify the action.
-
3. Re: CF8 DirectoryWatcher Gateway Doesn't Run When I Overwrite a File
BKBK May 24, 2009 10:47 AM (in response to molaro)If I set up 5 threads and 200 requests does that sound safe in general (I'm sure it depends on my server specs).
There is one way to find out: just do it, and see. The default values in the Administrator always good order-of-magnitude estimates. Incidentally, my default is 10 gateway processing threads.
-
4. Re: CF8 DirectoryWatcher Gateway Doesn't Run When I Overwrite a File
molaro May 25, 2009 8:10 AM (in response to molaro)I still haven;t determined why the Directory Watcher Gateway doesn't seem to run when I simply overwrite a file. This is disappointing because as of now I have taken my function code and updated it to be a scheduled task. This isn't as elegant because I have to add code to decide if the files in the directory are new or not (which is somewhat fuzzy) and run based on that determination. Does anybody have any ideas, tricks, workarounds as to why the DW gateway event doesn't fire when a file in the directory is overwritten??
-
5. Re: CF8 DirectoryWatcher Gateway Doesn't Run When I Overwrite a File
Texas_Ranger Jul 10, 2009 8:41 AM (in response to molaro)We had the same problem here, and I agree that it is disappointing that the DW doesn't consider that a new file. As far as a workaround, what I did was change the way our process dealt with incoming files entirely. I used to handle the files as they came in, relying on Dave Ferguson's tricks for getting around files that were still being written to or otherwise locked (thanks, Dave!). Now, instead of that, I only do one thing when a file is received: I rename it with a datestamp and write this to our db as the received filename so that the additional processes can be run on it. That way, when that same filename is used by our client again, which is every time, the DW picks it up again as a new file. I don't know if that helps or not, because it still means you lose the functionality that used to be inside the DW instead of a scheduled task, but at least you know when an actual new file is received, regardless of its name. You may even be able to put your functions inside the onChange or onDelete if you keep the reference to the original filename, then have those do your work after the file is renamed and/or moved. In our case, the DW also kept hanging every couple of days so we were missing very important files. I ended up just restarting the gateway through code as the last piece of the scheduled task that runs every 30 mins to process the files.

