Skip to content

Commit

Permalink
Extraigo constantes
Browse files Browse the repository at this point in the history
    refs:#133
  • Loading branch information
lucaslavandeira committed Jan 11, 2018
1 parent d3ac015 commit 1f974b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions series_tiempo_ar_api/apps/management/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from django.db import models
from django.utils import timezone

from . import strings
from series_tiempo_ar_api.apps.api.models import Catalog


Expand Down Expand Up @@ -87,10 +88,10 @@ def update_crontab():
python_exec = sys.executable
cwd = os.getcwd()

command = '%s %s/manage.py read_datajson' % (python_exec, cwd)
command = strings.INDEXING_COMMAND.format(python_exec, cwd)
cron = CronTab(user=getpass.getuser())

job_id = "API series tiempo: indexing de datos"
job_id = strings.CRONTAB_COMMENT
for job in cron.find_comment(job_id):
job.delete()

Expand Down
5 changes: 5 additions & 0 deletions series_tiempo_ar_api/apps/management/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
DATASET_STATUS = u"Dataset ({}, {}) status: {}"
FILE_READ_ERROR = u"Error en la lectura del archivo de entrada"
READ_ERROR = u"Error en la lectura del catálogo {}: {}"

# Identificador para los crons de indexing
CRONTAB_COMMENT = u"API series tiempo: indexing de datos"

INDEXING_COMMAND = '{} {}/manage.py read_datajson'

0 comments on commit 1f974b6

Please sign in to comment.