Skip to content

Commit

Permalink
new: expose max_retries feature to individual captures
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Nov 5, 2024
1 parent fca47f5 commit 6e94069
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions website/web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def get(self) -> bool:
'latitude': fields.Float(example=41.902916)
})

max_retries = get_config('generic', 'max_retries')

submit_fields_post = api.model('SubmitFieldsPost', {
'url': fields.Url(description="The URL to capture", example=''),
Expand All @@ -96,6 +97,7 @@ def get(self) -> bool:
'referer': fields.String(description="Referer to pass to the capture", example='https://circl.lu'),
'with_favicon': fields.Boolean(description="Attempts to get favicons related to the landing page of the capture", example=False),
'allow_tracking': fields.Boolean(description="Attempt to let the website violate your privacy", example=False),
'max_retries': fields.Integer(description=f"The maximum anount of retries for this capture (any value higher than {max_retries} will be ignored).", example=max_retries),
'force': fields.Boolean(description="Force a capture, even if the same one was already done recently", example=False),
'recapture_interval': fields.Integer(description="The minimal interval to re-trigger a capture, unless force is True", example=300),
'priority': fields.Integer(description="Priority of the capture, the highest, the better", example=-5),
Expand Down Expand Up @@ -131,6 +133,7 @@ def post(self) -> str:
referer=to_query.get('referer'),
with_favicon=to_query.get('with_favicon', False),
allow_tracking=to_query.get('allow_tracking', False),
max_retries=to_query.get('max_retries'),
rendered_hostname_only=to_query.get('rendered_hostname_only', True),
force=to_query.get('force', False),
recapture_interval=to_query.get('recapture_interval', 300),
Expand Down

0 comments on commit 6e94069

Please sign in to comment.