File locking

Create a temp file for file locking
Thanks for the suggestion. I will fix that.

On Tue, Sep 9, 2014 at 11:59 AM, Ryan Abouzahra <notifications@github.com>
wrote:

> In massDOT/store.py:
>
> >
> > -	logging.info('Data Feed: '+feedname+' Date/Time: '+lastUpdated)
> > -	logging.info('Response Time: '+`resTime`+' Write Time: '+`writeTime`)
> > -	logging.info('=========')
> > +    logging.info('Data Feed: '+feedname+' Date/Time: '+lastUpdated)
> > +    logging.info('Response Time: '+`resTime`+' Write Time: '+`writeTime`)
> > +    logging.info('=========')
> > +
> > +fh = open(os.getcwd()+'/tmp/massDOT.lock')
> > +try:
> > +    fcntl.flock(fh, fcntl.LOCK_EX|fcntl.LOCK_NB)
> > +except IOError:
> > +    warning.warn("The acquired lock is blocked")
>
> Yes, but you never define a warning variable. If this line of code runs,
> the program will crash with something like NameError: name 'warning' is
> not defined. Ian suggested that perhaps you meant to write logging.warn("The
> acquired lock is blocked").
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/CCI-MOC/MGHPCC/pull/3/files#r17310006>.
>