Skip to content

Commit

Permalink
luau: minor tweaks
Browse files Browse the repository at this point in the history
- set TIMEOUT_SECS to 30, aligned with docopt default of 30, which overrides it anyway
- explicitly flush and close qsv_register_lookup cache file
- remove unused assignment
  • Loading branch information
jqnatividad committed Nov 22, 2023
1 parent 2b72cfd commit 83066a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cmd/luau.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ impl TryFrom<i8> for Stage {

static LUAU_STAGE: AtomicI8 = AtomicI8::new(0);

static TIMEOUT_SECS: AtomicU16 = AtomicU16::new(15);
static TIMEOUT_SECS: AtomicU16 = AtomicU16::new(30);

pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
Expand Down Expand Up @@ -2297,16 +2297,18 @@ fn setup_helpers(
let download_elapsed = download_start.elapsed().as_millis();
writeln!(cache_file, "# Download-duration-ms: {download_elapsed}")?;
cache_file.write_all(lookup_csv_contents.as_bytes())?;

// explicitly flush and close the file
cache_file.flush()?;
drop(cache_file);
}

lookup_table_uri = cache_file_path.to_string_lossy().to_string();
}
}

let lookup_table = luau.create_table()?;
#[allow(unused_assignments)]
let mut record = csv::StringRecord::new();
let mut record: csv::StringRecord;

let conf = Config::new(&Some(lookup_table_uri.clone()))
.delimiter(delimiter)
Expand Down

0 comments on commit 83066a6

Please sign in to comment.