From a3a2165f438244eb7cc8bd474f714725190caa00 Mon Sep 17 00:00:00 2001 From: pablomartincalvo Date: Tue, 23 Oct 2018 23:18:12 +0200 Subject: [PATCH] Testeando error en geocoder. --- .idea/workspace.xml | 276 +++++++++++++++++---------------- db_layer/capturas_interface.py | 4 +- deployer.sh | 28 ++++ geocoder/geocoder.py | 2 +- 4 files changed, 172 insertions(+), 138 deletions(-) create mode 100644 deployer.sh diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 117623b..0a1a880 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,9 @@ + - + @@ -273,41 +295,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -350,7 +337,7 @@ - + + + + - - - - + + - @@ -617,7 +604,14 @@ @@ -633,21 +627,21 @@ - + - + - + @@ -729,6 +723,11 @@ 38 @@ -881,13 +880,6 @@ - - - - - - - @@ -909,13 +901,6 @@ - - - - - - - @@ -936,20 +921,6 @@ - - - - - - - - - - - - - - @@ -964,6 +935,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -971,13 +970,6 @@ - - - - - - - @@ -985,10 +977,24 @@ + + + + + + + + + + + + + + - - + + diff --git a/db_layer/capturas_interface.py b/db_layer/capturas_interface.py index 9e4c690..f69df35 100644 --- a/db_layer/capturas_interface.py +++ b/db_layer/capturas_interface.py @@ -60,11 +60,11 @@ class CapturasInterface(): def not_geocoded_captura_exists(self): query_statement = """ - SELECT COUNT(referencia) + SELECT COUNT(referencia) as cantidad FROM anuncios.capturas WHERE `precision` IS NULL""" - cursor_result = self.anunciosdb.query(query_statement, dictionary=True) + cursor_result = self.anunciosdb.query(query_statement) result = cursor_result.fetchone()[0] return result > 0 diff --git a/deployer.sh b/deployer.sh new file mode 100644 index 0000000..bf20137 --- /dev/null +++ b/deployer.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e + + + + +https://www.phusionpassenger.com/library/deploy/nginx/automating_app_updates/python/ + +### Variables de entorno ### +DB_PATH=drogon_db + + + +apt-get update + +### Set up de PIP ### +if ! [ -x "$(pip -v git)" ]; then + sudo apt-get -y install python3-pip +fi + + + +### Set up de Docker ### + + + +### Set up de GIT ### \ No newline at end of file diff --git a/geocoder/geocoder.py b/geocoder/geocoder.py index 9bb674f..298d243 100644 --- a/geocoder/geocoder.py +++ b/geocoder/geocoder.py @@ -13,7 +13,7 @@ class Geocoder: def start(self): while True: - sleep(120) + sleep(1) print("Exists: {}".format(capturas_interface.not_geocoded_captura_exists()))