Commit 5bb5635
committed
Nominatim: limit requests to one per second
The Nominatim usage policy allows "an absolute maximum of 1 request per
second", but nothing throttled submits: holding Enter or clicking the search
button repeatedly sent one request per keypress.
Queue geocode() and reverse() behind a per-instance promise chain that spaces
the start of consecutive requests at least a second apart. Requests are
delayed rather than dropped, and the chain resolves to a timestamp so a failed
request cannot stall the ones behind it.
https://operations.osmfoundation.org/policies/nominatim/1 parent 68bfbf6 commit 5bb5635
1 file changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
| |||
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
93 | 105 | | |
94 | 106 | | |
95 | 107 | | |
96 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
97 | 126 | | |
98 | 127 | | |
99 | 128 | | |
100 | 129 | | |
101 | 130 | | |
102 | 131 | | |
103 | 132 | | |
| 133 | + | |
104 | 134 | | |
105 | 135 | | |
106 | 136 | | |
| |||
138 | 168 | | |
139 | 169 | | |
140 | 170 | | |
| 171 | + | |
141 | 172 | | |
142 | 173 | | |
143 | 174 | | |
| |||
0 commit comments