Cron job, I can't get past waiting for an instance to finish
Posted: Mon Nov 04, 2013 3:28 am
I couldn't get past one thing,
say we have 100 instances of the script that is running through cron
it seems up until the 1st instance did not finish running entirely
that the database does not get updated therefore for an instance to finish
it could take 10 minutes and all other 99 would be trying to work on the same
position as the 1st one
we need to somehow free this up by being able to update the database and then initiate
an instance
does that make sense?
I have a position database,
position 0
I start running a script through cron and I update the position to say 200.
Then if I were to run the same script in parallel multiple times I am unable to read the position updates because for some reason up until an instance has completely finished running (which could take up to 10 mins. run)
the database doesn't get the update
Thanks
say we have 100 instances of the script that is running through cron
it seems up until the 1st instance did not finish running entirely
that the database does not get updated therefore for an instance to finish
it could take 10 minutes and all other 99 would be trying to work on the same
position as the 1st one
we need to somehow free this up by being able to update the database and then initiate
an instance
does that make sense?
I have a position database,
position 0
I start running a script through cron and I update the position to say 200.
Then if I were to run the same script in parallel multiple times I am unable to read the position updates because for some reason up until an instance has completely finished running (which could take up to 10 mins. run)
the database doesn't get the update
Thanks