]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/clicmd/refresh.py
port database setup function to python
[nominatim.git] / nominatim / clicmd / refresh.py
index f68e185ac2281ae98bf9053211c7b7efb3cd7d2b..5dca41defc3a2241c0f5c1ef39624fa0819d02d1 100644 (file)
@@ -50,13 +50,11 @@ class UpdateRefresh:
 
         if args.postcodes:
             LOG.warning("Update postcodes centroid")
-            with connect(args.config.get_libpq_dsn()) as conn:
-                refresh.update_postcodes(conn, args.sqllib_dir)
+            refresh.update_postcodes(args.config.get_libpq_dsn(), args.sqllib_dir)
 
         if args.word_counts:
             LOG.warning('Recompute frequency of full-word search terms')
-            with connect(args.config.get_libpq_dsn()) as conn:
-                refresh.recompute_word_counts(conn, args.sqllib_dir)
+            refresh.recompute_word_counts(args.config.get_libpq_dsn(), args.sqllib_dir)
 
         if args.address_levels:
             cfg = Path(args.config.ADDRESS_LEVEL_CONFIG)