Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #11482

Re: Data issues with Django and Apache

From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: Data issues with Django and Apache
Date 2011-08-16 00:10 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <j2cchc$167$1@reader1.panix.com> (permalink)
References <j27bde$dlr$1@reader1.panix.com>

Show all headers | View raw


In <j27bde$dlr$1@reader1.panix.com> John Gordon <gordon@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@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Data issues with Django and Apache John Gordon <gordon@panix.com> - 2011-08-14 02:20 +0000
  Re: Data issues with Django and Apache Daniel Roseman <daniel@roseman.org.uk> - 2011-08-14 11:12 -0700
    Re: Data issues with Django and Apache John Gordon <gordon@panix.com> - 2011-08-14 23:43 +0000
  Re: Data issues with Django and Apache John Gordon <gordon@panix.com> - 2011-08-16 00:10 +0000

csiph-web