]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/index.c
change default nominatim path for tests to obvious '..'
[nominatim.git] / nominatim / index.c
index 9667e50565e4ea1e96b6fc7e2bcd056bb0876f71..13f292737082f5a4185c45086b6ff90d265c91eb 100644 (file)
@@ -308,6 +308,13 @@ void nominatim_index(int rank_min, int rank_max, int num_threads, const char *co
     {
         nominatim_exportXMLEnd(writer);
     }
     {
         nominatim_exportXMLEnd(writer);
     }
+
+    // Close all connections
+    for (i = 0; i < num_threads; i++)
+    {
+        PQfinish(thread_data[i].conn);
+    }
+    PQfinish(conn);
 }
 
 void *nominatim_indexThread(void * thread_data_in)
 }
 
 void *nominatim_indexThread(void * thread_data_in)
@@ -369,8 +376,7 @@ void *nominatim_indexThread(void * thread_data_in)
                        {
                            fprintf(stderr, "index_placex: UPDATE failed: %s", PQerrorMessage(thread_data->conn));
                            PQclear(res);
                        {
                            fprintf(stderr, "index_placex: UPDATE failed: %s", PQerrorMessage(thread_data->conn));
                            PQclear(res);
-                            sleep(rand() % 10);
-//                         exit(EXIT_FAILURE);
+                           exit(EXIT_FAILURE);
                        }
                }
         }
                        }
                }
         }