mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Merge pull request #2161 from lonvia/timeout-for-replication
Reintroduce timeout for replication file download
This commit is contained in:
@@ -4,6 +4,7 @@ database administration and querying.
|
|||||||
"""
|
"""
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
import os
|
import os
|
||||||
|
import socket
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import argparse
|
import argparse
|
||||||
@@ -261,11 +262,16 @@ class UpdateReplication:
|
|||||||
together with --once""")
|
together with --once""")
|
||||||
group.add_argument('--osm2pgsql-cache', metavar='SIZE', type=int,
|
group.add_argument('--osm2pgsql-cache', metavar='SIZE', type=int,
|
||||||
help='Size of cache to be used by osm2pgsql (in MB)')
|
help='Size of cache to be used by osm2pgsql (in MB)')
|
||||||
|
group = parser.add_argument_group('Download parameters')
|
||||||
|
group.add_argument('--socket-timeout', dest='socket_timeout', type=int, default=60,
|
||||||
|
help='Set timeout for file downloads.')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _init_replication(args):
|
def _init_replication(args):
|
||||||
from .tools import replication, refresh
|
from .tools import replication, refresh
|
||||||
|
|
||||||
|
socket.setdefaulttimeout(args.socket_timeout)
|
||||||
|
|
||||||
LOG.warning("Initialising replication updates")
|
LOG.warning("Initialising replication updates")
|
||||||
conn = connect(args.config.get_libpq_dsn())
|
conn = connect(args.config.get_libpq_dsn())
|
||||||
replication.init_replication(conn, base_url=args.config.REPLICATION_URL)
|
replication.init_replication(conn, base_url=args.config.REPLICATION_URL)
|
||||||
|
|||||||
Reference in New Issue
Block a user