Corrige sessões duplicadas ao reabrir uma sessão recente
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
627eae1b8b
commit
b1ac320193
2 files changed
+21
-4
No files matched your search
@@ -721,6 +721,17 @@ impl Engine {
|
||||
}
|
||||
|
||||
pub fn load_session(&self, path: &str) -> Result<String> {
|
||||
// Clicar de novo numa sessão já aberta reaproveita o job em vez de criar outro igual.
|
||||
let want = Path::new(path);
|
||||
if let Some(j) = self
|
||||
.jobs
|
||||
.lock()
|
||||
.unwrap()
|
||||
.values()
|
||||
.find(|j| j.session_file.lock().unwrap().as_deref() == Some(want))
|
||||
{
|
||||
return Ok(j.id.clone());
|
||||
}
|
||||
let bytes = std::fs::read(path).map_err(|e| {
|
||||
if e.kind() == std::io::ErrorKind::PermissionDenied {
|
||||
Error::msg(format!(
|
||||
|
||||
Reference in new issue
Block a user