Safe2COVIDApp / bct-server

Bluetooth Contact Tracing for Covid19 - server
5 stars 1 forks source link

Reject requests for too many results #120

Closed mitra42 closed 4 years ago

mitra42 commented 4 years ago

in send/scan When a client makes a request that results in too many datapoints being returned, then the set should be restricted to some arbitrary amount and 'until' time should be set to the time before which all results are returned and more_data set to True to indicate it should re-request.

This could be done in /sync, but there is not much point since the load cost of recalculating is likely to be larger.

mitra42 commented 4 years ago

@danaronson I think you just completed this ?

danaronson commented 4 years ago

nope, just did it for sync.

mitra42 commented 4 years ago

Ok - I can look at this

mitra42 commented 4 years ago

I've got this working - it turned out best way was to merge the guts of sync and scan so they could both use the same sorted-list mechanism. Its in feature/add_scan_limit

@danaronson I've not done a PR because a) it depends on PR #135 b) Open question to you about an ugly yield from iter(sorted_list) I'm sure that must be wrong, but I can't figure out the correct answer, returning the list doesnt work, nor return return iter(sorted_List)

mitra42 commented 4 years ago

This was merged a while back