On Aug 8, 6:03 pm, Nick Arnett <nick.arn...@gmail.com> wrote: > I'm having a problem that I can't figure out from reading the docs. I have > a loop that runs the same query every five minutes, to see if there is new > data to process. However, it doesn't return the new data the second and > subsequent times it loops. It's something like this: > > while 1: > data = Foo.objects.filter(not_analyzed=True) > if len(data): > for item in data: > do_analysis(item) > sleep(300) > > Even though I know there is new data added while it is sleeping, the query > doesn't return it. If I kill the process and re-start, it finds the new > data, so it smells like a caching problem... but I don't see anything in the > documentation that would suggest this. It shouldn't be the database query > cache (MySQL) because it should know the data has changed. > > I've tried adding "del data" at the bottom of the loop, but that didn't help > - thought maybe if I explicitly deleted the data, that would work. > > Any ideas what's going on or how to solve this? > > TIA, > > Nick
Where is this query running - in a view, or an external script? And how is the data being added to the db? -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.