Adding SQL limits

This commit is contained in:
Chris Lai
2022-10-04 13:34:51 +01:00
parent 50e31442ea
commit 064918aa1e
2 changed files with 4 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ services:
container_name: thesillyhome
image: lcmchris1/thesillyhome-container:dev
restart: unless-stopped
external: true
volumes:
- thesillyhome_config:/thesillyhome_src/data/config/
ports:

View File

@@ -77,7 +77,9 @@ class homedb:
last_changed ,\
last_updated ,\
old_state_id \
from states ORDER BY last_updated DESC;"
from states \
WHERE entity_id in ({str(tsh_config.devices)[1:-1]})\
ORDER BY last_updated DESC LIMIT 100000;"
with self.mydb.connect() as con:
con = con.execution_options(stream_results=True)
list_df = [