Data issues with Django and Apache

John Gordon gordon at panix.com
Tue Aug 16 02:10:21 CEST 2011


In <j27bde$dlr$1 at reader1.panix.com> John Gordon <gordon at panix.com> writes:

> The problem is that I get conflicting results as to whether these temporary
> records have reached their expiration date, depending if I search for them
> via an Apache web call or if I do the search locally from a python shell.

> And to make it weirder, the conflicts go away if I stop and restart the
> Apache server, although any new records created after this point will still
> exhibit the issue.

The problem turned out to be a class variable that contained a time filter
with the "current" time.

But since it was a class variable, it was only evaluated once upon import
and its idea of "now" was forever frozen at that moment, so it always
compared as being less than any of the lock records that were passed in.

I changed it to be a class method that constructs and returns a new time
filter whenever it is called.

Thanks for everyone's help!

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"




More information about the Python-list mailing list