Could anyone help me figure out how to configure J...
# talk-hydra
l
Could anyone help me figure out how to configure Janitor properly to clean up requests? We used it successfully for token cleanup, but no luck with requests.
Here is the command we issue for requests:
Copy code
hydra janitor -e --requests --keep-if-younger 23h --limit "10000000"
And Looks like Janitor is running:
Copy code
time=2023-05-10T12:20:50Z level=info msg=No tracer configured - skipping tracing setup audience=application service_name=ORY Hydra service_version=v1.10.5
And we can see that it is hitting the database. But the activity is having no impact on: • hydra_oauth2_authentication_request • hydra_oauth2_authentication_request_handled What do we need to do differently?
p
Hi @little-fireman-5336 I'm assuming you are running Hydra 1.x? The janitor command only affects expired requests and tokens. Here is the description within the codebase of 1.x
Select challenges from all consent requests that can be safely deleted with limit
where hydra_oauth2_consent_request were unhandled or rejected, so either of these is true
hydra_oauth2_authentication_request_handled does not exist (unhandled)
hydra_oauth2_consent_request_handled has valid error (rejected)
AND timed-out
hydra_oauth2_consent_request.requested_at < minimum between ttl.login_consent_request and notAfter
https://github.com/ory/hydra/blob/v1.11.10/persistence/sql/persister_consent.go#L471-L477 As you can see in Hydra 2.x the janitor command will purge requests within the
hydra_oauth2_flow
table https://github.com/ory/hydra/blob/3703e5a7b1a910a15e2118c9ad5cba93e54e4d3d/persistence/sql/persister_consent.go#L649 You can take a look at this issue for more insight https://github.com/ory/hydra/issues/2514