Laurie, You probably need to use a backpressure of 1 before the wait, possibly holding up a clone of the file being processed (I.e.two "success" relationships from GetFile ,one for processing and one for the Wait)...
Brandon On Fri, Apr 27, 2018 at 11:31 PM Laurie McIntosh <[email protected]> wrote: > Hi there, > > I'm processing lots of files at a time. I get them, import csv into a > mysql table, do some post stuff, move the file. > > I need to process these files one at a time. That is, I can't just > concatenate the files into one uber-file and process it. > > One of the things I do is truncate the file that the csv is going into. I > import the data, and then do some other stuff on the table (a staging > table) then import the data into the production table. > > If file 2 starts being processed before file 1 has finished, the staging > table will be truncated before the data has been processed and moved to > production. SO I need the other files to Wait before proceeding. > > This sounds like a job for Wait/Notify but I can't get the logic to work. > It should go: > > 1/ Get File 1 > 2/ If no other files being processed then proceed with process > 3/ Import > 4/ Process > 5/ Move data to production > 6/ Move the file > > ... > 7/ Start processing File 2 > > I'm missing something obvious here or I'm barking up the wrong tree with > Wait/Notify. > > What's the right way to do this? > > Many thanks, > > ---=Laurie >
