[openstreetmap/openstreetmap-website] Maybe rate limit changeset size? (Issue #4805)

Roman Deev notifications at github.com
Tue Jun 18 09:36:30 UTC 2024


> Of course then they will just switch to uploading multiple smaller batches into one changeset.

But what if we sum up the area of the last edits? It seems that it will be enough to add after line 49 something like

https://github.com/openstreetmap/openstreetmap-website/blob/2d09b9408b4f3f9a7c7a5782098c6c5b81ae1206/lib/database_functions.rb#L49-L54

Something like

```sql
SELECT COALESCE(SUM((changesets.max_lon / 10000000 - changesets.min_lon / 10000000) +
                    (changesets.max_lat / 10000000 - changesets.min_lat / 10000000)), 0)
INTO recent_changesets_area
FROM changesets
where changesets.created_at >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - '5 minute'::interval;

max_changes := max_changes / GREATEST(recent_changesets_area, 1);
```

This will skip the first big edit, but it will give DWG and the community time to react to big edits. 


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/4805#issuecomment-2175654253
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/4805/2175654253 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240618/15910992/attachment-0001.htm>


More information about the rails-dev mailing list