-
-
Notifications
You must be signed in to change notification settings - Fork 243
Expand file tree
/
Copy pathconstants.rs
More file actions
53 lines (42 loc) · 2 KB
/
constants.rs
File metadata and controls
53 lines (42 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Provides some useful constants.
use std::time::Duration;
/// Application name
pub const APP_NAME: &str = "sentrycli";
/// The default API URL
pub const DEFAULT_URL: &str = "https://sentry.io/";
/// The version of the library
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
/// The name of the configuration file.
pub const CONFIG_RC_FILE_NAME: &str = ".sentryclirc";
/// The relative path of the configuration file in dirs::config_dir()
pub const CONFIG_INI_FILE_PATH: &str = "sentry/sentrycli.ini";
/// The release registry URL where the latest released version of sentry-cli can be found
pub const RELEASE_REGISTRY_LATEST_URL: &str =
"https://release-registry.services.sentry.io/apps/sentry-cli/latest";
/// The file extension of the binary (.exe or empty string)
#[cfg(windows)]
pub const EXT: &str = ".exe";
/// The file extension of the binary (.exe or empty string)
#[cfg(not(windows))]
pub const EXT: &str = "";
/// Backoff multiplier (1.5 which is 50% increase per backoff).
pub const DEFAULT_MULTIPLIER: f64 = 1.5;
/// Backoff randomization factor (0 means no randomization).
pub const DEFAULT_RANDOMIZATION: f64 = 0.1;
/// Initial backoff interval in milliseconds.
pub const DEFAULT_INITIAL_INTERVAL: u64 = 1000;
/// Maximum backoff interval in milliseconds.
pub const DEFAULT_MAX_INTERVAL: u64 = 5000;
/// Default number of retry attempts
pub const DEFAULT_RETRIES: u32 = 5;
/// Default maximum file size of DIF uploads.
pub const DEFAULT_MAX_DIF_SIZE: u64 = 2 * 1024 * 1024 * 1024; // 2GB
/// Default maximum file size of a single file inside DIF bundle.
pub const DEFAULT_MAX_DIF_ITEM_SIZE: u64 = 1024 * 1024; // 1MB
/// Default maximum DIF upload size.
pub const DEFAULT_MAX_DIF_UPLOAD_SIZE: u64 = 35 * 1024 * 1024; // 35MB
/// Default maximum time to wait for file assembly.
pub const DEFAULT_MAX_WAIT: Duration = Duration::from_secs(5 * 60);
/// Maximum length for commit SHA values, enforced in backend.
pub const MAX_COMMIT_SHA_LENGTH: usize = 64;
include!(concat!(env!("OUT_DIR"), "/constants.gen.rs"));