Closed dthonon closed 2 years ago
C'est "normal", le format JSON long ne fonctionne que pour un stockage en fichier. Pour le stockage Postgresql, le format long est inutile car il comporte trop d'informations et augmente inutilement le volume de transfert.
Je vais ajouter un message plus explicite en cas de format long et d'utilisation de PG.
In GitLab by @mgageo on Dec 15, 2021, 13:04
Je joins mon fichier yaml avec mes modifications pour passer de postgresql aux fichiers faune-bretagne_long.yaml
Bon, il faudra que je creuse plus, car la sortie PG est bien inhibée dans le fichier YAML. Merci pour cette précision.
mentioned in commit 60b743bee470a4e5271b4e452b4c7bf3a19499ce
En fait, le test if cfg.db_enabled and cfg.json_format != "short":
est déjà réalisé.
mentioned in commit 82d456c5a12faf078f328f941893701910a94472
mentioned in commit de3cdf5a0dd4c423822047b9cc9a14bfbaff2781
In GitLab by @mgageo on Dec 15, 2021, 10:57
J'ai modifié le fichier yaml
json_format: long
file:
Enable storing to file
database:
Enable storing to database
mais j'ai cette erreur
2021-12-15 10:41:21,610 - INFO - transfer_vn.store_postgresql - Reading from local_admin_units of site fb
Job "full_download_1 (trigger: date[2021-12-15 09:41:20 UTC], next run at: 2021-12-15 09:41:20 UTC)" raised an exception
Traceback (most recent call last):
File "/home/xfer38/VN_env/lib/python3.7/site-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "/home/xfer38/VN_env/lib/python3.7/site-packages/export_vn/transfer_vn.py", line 385, in full_download_1
downloader = ctrl(cfg, store_all)
File "/home/xfer38/VN_env/lib/python3.7/site-packages/export_vn/download_vn.py", line 834, in init
self._l_a_units = ReadPostgresql(self._config).read("local_admin_units")
File "/home/xfer38/VN_env/lib/python3.7/site-packages/export_vn/store_postgresql.py", line 799, in read
metadata = self._table_defs[controler]["metadata"]
AttributeError: 'ReadPostgresql' object has no attribute '_table_defs'
2021-12-15 10:41:21,611 - ERROR - transfer_vn - The job Places_fb crashed