You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the curl command again to import, then reissue the command and they should increment.
TODOs for this
dynamically specify a counter_id. I envision this working so if the upload request hits example.com/some_portal, the counter_id will be set as some_portal. From the frontend, this would let you submit different image 'batches' to different endpoints and get back the relevant counts, theoretically by hitting example.com/counts/some_portal. Probably this needs to be implemented carefully so it can't be doss'ed by people submitting really long keys (some validation required on the counter_id string).
Maybe tie this into a frontend template.
The text was updated successfully, but these errors were encountered:
Here's a cool feature at commit: 95e5a23
REDIS COUNTS YEAAA.
Since we're already using redis in the project, it's pretty trival to add counts, using Redis'
HINCRBY
.Basically we create a redis hash, which at the moment is
obj_cnt:default
with a field for each item.So you can
curl
a few images as usual, then hit the following endpoint to get a list of overall counts, for images submitted through the system:This may be useful if you're submitting a whole load of images, and what to keep track of what was found in those images.
Notice in that commit I've also grabbed the threshold from the env var
COUNT_THRESHOLD
This lets you set it in the
docker-compose.yml
file. Something like:Now only results above that threshold will be counted. If it's not set there it defaults to
0
.If you want, you can also check this out from inside the redis container:
Then use the
HGETALL
command to see the counts for everything in the specified field:Run the
curl
command again to import, then reissue the command and they should increment.TODOs for this
dynamically specify a
counter_id
. I envision this working so if the upload request hitsexample.com/some_portal
, thecounter_id
will be set assome_portal
. From the frontend, this would let you submit different image 'batches' to different endpoints and get back the relevant counts, theoretically by hittingexample.com/counts/some_portal
. Probably this needs to be implemented carefully so it can't be doss'ed by people submitting really long keys (some validation required on the counter_id string).Maybe tie this into a frontend template.
The text was updated successfully, but these errors were encountered: