Here is my job:
We have ten different topics with keywords.
Every day we do a cron job for one of the keywords of every topic.
The keywords are more or less finished, there will be less new ones in future.
Solution I
I add ten option_ fields plus one as counter like
name1
color: red, blue, green
name2
size: s, m, l, xl
name3
animals: cats, dogs, birds
...
counter starts with 1
now we do ten times the cron in a day:
1. Fetch counter; => 1
2. fetch the array from name{1}
3. take the first keyword; => red
4. Move the first keyword to the end of the array, save the list, now: blue, green, red
5. save the counter++ while counter < 10 => now 2
6 do the cron-job with "red"
five minutes later
1. Fetch counter; => 2
2. fetch the array from name{2}
3. take the first keyword; => s
4. Move the first keyword to the end of the array, save the list, now: m, l, xl, s
5. save the counter++ while counter < 10 => now 3
6 do the cron-job with "s"
...
Any better idea how to solve this?
We have ten different topics with keywords.
Every day we do a cron job for one of the keywords of every topic.
The keywords are more or less finished, there will be less new ones in future.
Solution I
I add ten option_ fields plus one as counter like
name1
color: red, blue, green
name2
size: s, m, l, xl
name3
animals: cats, dogs, birds
...
counter starts with 1
now we do ten times the cron in a day:
1. Fetch counter; => 1
2. fetch the array from name{1}
3. take the first keyword; => red
4. Move the first keyword to the end of the array, save the list, now: blue, green, red
5. save the counter++ while counter < 10 => now 2
6 do the cron-job with "red"
five minutes later
1. Fetch counter; => 2
2. fetch the array from name{2}
3. take the first keyword; => s
4. Move the first keyword to the end of the array, save the list, now: m, l, xl, s
5. save the counter++ while counter < 10 => now 3
6 do the cron-job with "s"
...
Any better idea how to solve this?