pull in rust updates

This commit is contained in:
Nikhil Narayana 2023-08-13 16:52:07 -07:00
commit 065823f71e
No known key found for this signature in database
GPG key ID: 1B34839FA8D6245E
3 changed files with 9 additions and 11 deletions

View file

@ -155,11 +155,11 @@ pub fn update_container(kind: *const c_char, enabled: bool, level: c_int) {
pub fn mainline_update_log_level(level: c_int) {
let containers = LOG_CONTAINERS
.get()
.expect("[dolphin_logger::update_container]: Attempting to get `LOG_CONTAINERS` before init");
.expect("[dolphin_logger::mainline_update_log_level]: Attempting to get `LOG_CONTAINERS` before init");
let mut writer = containers
.write()
.expect("[dolphin_logger::update_container]: Unable to acquire write lock on `LOG_CONTAINERS`?");
.expect("[dolphin_logger::mainline_update_log_level]: Unable to acquire write lock on `LOG_CONTAINERS`?");
for container in (*writer).iter_mut() {
container.level = convert_dolphin_log_level_to_tracing_level(level);

View file

@ -43,4 +43,4 @@ pub extern "C" fn slprs_logging_update_container(kind: *const c_char, enabled: b
#[no_mangle]
pub extern "C" fn slprs_mainline_logging_update_log_level(level: c_int) {
dolphin_integrations::ffi::logger::mainline_update_log_level(level);
}
}

View file

@ -47,12 +47,10 @@ pub struct GameReporterQueue {
impl GameReporterQueue {
/// Initializes and returns a new game reporter.
pub(crate) fn new() -> Self {
// `max_idle_connections` is set to `0` to mimic how the CURL setup in the
// C++ version was done - i.e, I don't want to introduce connection pooling
// without Fizzi/Nikki opting in to it.
// We set `max_idle_connections` to `5` to mimic how CURL was configured in
// the old C++ version of this module.
let http_client = ureq::AgentBuilder::new()
//.https_only(true)
.max_idle_connections(0)
.max_idle_connections(5)
.user_agent("SlippiGameReporter/Rust v0.1")
.build();
@ -103,10 +101,10 @@ impl GameReporterQueue {
match res {
Ok(value) if value == "true" => {
tracing::info!(target: Log::GameReporter, "Successfully executed abandonment request")
tracing::info!(target: Log::GameReporter, "Successfully executed completion request")
},
Ok(value) => tracing::error!(target: Log::GameReporter, ?value, "Error executing abandonment request",),
Err(error) => tracing::error!(target: Log::GameReporter, ?error, "Error executing abandonment request"),
Ok(value) => tracing::error!(target: Log::GameReporter, ?value, "Error executing completion request",),
Err(error) => tracing::error!(target: Log::GameReporter, ?error, "Error executing completion request"),
}
}