matthewwall / weewx-influx

uploader for influxdb
GNU General Public License v3.0
45 stars 22 forks source link

No attribute 'archive_queue' #12

Closed docwelch closed 6 years ago

docwelch commented 6 years ago

Just downloaded and installed weewx-influx. I have added database, port, host, admin username/password to weewx.conf. When I restart weewx, it fails. Here are the last few lines of the log:

File "/usr/share/weewx/user/influx.py", line 250, in __init__
  data_thread = InfluxThread(self.archive_queue, **site_dict)
AttributeError: 'Influx' object has no attribute 'archive_queue' 
Exiting.

Looking at commit https://github.com/matthewwall/weewx-influx/commit/1986ec39b1a41529a7306ce82a15537b05bc0004, it appears you removed the definition of self.archive_queue and added a definition for data_queue.

A simple fix seems to be adding the following just below the definition of data_queue:

self.archive_queue = data_queue

However, I am not sure that's really the correct fix for this when I look at the next 20 or so lines of code.

Thanks for your help

matthewwall commented 6 years ago

sorry about that oversight. fixed at commit 0a604ee

(other uploaders just use archive_queue, but i was trying to make influx use both archive and loop as per later changes to the weewx restx base class)

docwelch commented 6 years ago

Hmmm - line 270 has the self.archive_queue variable as well. Weewx crashes after running briefly at line 270:

File "/usr/share/weewx/user/influx.py", line 270, in new_archive_record
self.archive_queue.put(event.record)
AttributeError: 'Influx' object has no attribute 'archive_queue'
matthewwall commented 6 years ago

sorry, try again. commit 35c7b1c

docwelch commented 6 years ago

That seems to have solved the issue - Thanks!