]> git.openstreetmap.org Git - nominatim.git/blobdiff - src/nominatim_db/clicmd/refresh.py
Revert "work round typing bug in pyosmium 4.0"
[nominatim.git] / src / nominatim_db / clicmd / refresh.py
index 363bad7853431851264f53eab83be7f277e46e07..741411658e6977ee5dc4552a9f93b5b07d28d3b6 100644 (file)
@@ -11,6 +11,7 @@ from typing import Tuple, Optional
 import argparse
 import logging
 from pathlib import Path
 import argparse
 import logging
 from pathlib import Path
+import asyncio
 
 from ..config import Configuration
 from ..db.connection import connect, table_exists
 
 from ..config import Configuration
 from ..db.connection import connect, table_exists
@@ -68,7 +69,8 @@ class UpdateRefresh:
         group.add_argument('--importance', action='store_true',
                            help='Recompute place importances (expensive!)')
         group.add_argument('--website', action='store_true',
         group.add_argument('--importance', action='store_true',
                            help='Recompute place importances (expensive!)')
         group.add_argument('--website', action='store_true',
-                           help='Refresh the directory that serves the scripts for the web API')
+                           help='DEPRECATED. This function has no function anymore'
+                                ' and will be removed in a future version.')
         group.add_argument('--data-object', action='append',
                            type=_parse_osm_object, metavar='OBJECT',
                            help='Mark the given OSM object as requiring an update'
         group.add_argument('--data-object', action='append',
                            type=_parse_osm_object, metavar='OBJECT',
                            help='Mark the given OSM object as requiring an update'
@@ -99,7 +101,7 @@ class UpdateRefresh:
                                            args.project_dir, tokenizer)
                 indexer = Indexer(args.config.get_libpq_dsn(), tokenizer,
                                   args.threads or 1)
                                            args.project_dir, tokenizer)
                 indexer = Indexer(args.config.get_libpq_dsn(), tokenizer,
                                   args.threads or 1)
-                indexer.index_postcodes()
+                asyncio.run(indexer.index_postcodes())
             else:
                 LOG.error("The place table doesn't exist. "
                           "Postcode updates on a frozen database is not possible.")
             else:
                 LOG.error("The place table doesn't exist. "
                           "Postcode updates on a frozen database is not possible.")
@@ -158,14 +160,8 @@ class UpdateRefresh:
                 refresh.recompute_importance(conn)
 
         if args.website:
                 refresh.recompute_importance(conn)
 
         if args.website:
-            webdir = args.project_dir / 'website'
-            LOG.warning('Setting up website directory at %s', webdir)
-            # This is a little bit hacky: call the tokenizer setup, so that
-            # the tokenizer directory gets repopulated as well, in case it
-            # wasn't there yet.
-            self._get_tokenizer(args.config)
-            with connect(args.config.get_libpq_dsn()) as conn:
-                refresh.setup_website(webdir, args.config, conn)
+            LOG.error('WARNING: Website setup is no longer required. '
+                      'This function will be removed in future version of Nominatim.')
 
         if args.data_object or args.data_area:
             with connect(args.config.get_libpq_dsn()) as conn:
 
         if args.data_object or args.data_area:
             with connect(args.config.get_libpq_dsn()) as conn: