gr/
api_defaults.rs

1// Limits the number of pages we can pull from the remote.
2// Default number or results per_page:
3// Github 30
4// Gitlab 20
5// Max number of pages to pull from the remote.
6pub const REST_API_MAX_PAGES: u32 = 10;
7
8// Number of requests remaining threshold. If we reach, we stop for precaution
9// before we reach 0.
10pub const RATE_LIMIT_REMAINING_THRESHOLD: u32 = 10;
11
12// most limiting Github 5000/60 = 83.33 requests per minute. Round
13// up to 80.
14pub const DEFAULT_NUMBER_REQUESTS_MINUTE: u32 = 80;
15
16// Default number of results per page for --num-resources. Gitlab 20, Github 30
17// As this is an approximation, we will use 30 if per_page is not provided.
18pub const DEFAULT_PER_PAGE: u32 = 30;
19
20pub const EXPIRE_IMMEDIATELY: &str = "0s";
21
22// Default jitter values for autorate throttling.
23pub const DEFAULT_JITTER_MAX_MILLISECONDS: u64 = 5000;
24pub const DEFAULT_JITTER_MIN_MILLISECONDS: u64 = 1000;
25
26// Trigger autorate throttling after 3 API calls.
27pub const ENGAGE_AUTORATE_THROTTLING_THRESHOLD: u32 = 3;