Skip to content

Commit

Permalink
Revert "Unlock farm explicitly on drop"
Browse files Browse the repository at this point in the history
This reverts commit 837c9cb.
  • Loading branch information
nazar-pc committed Dec 20, 2023
1 parent 3629234 commit e3daa7c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions crates/subspace-farmer/src/single_disk_farm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,7 @@ impl SingleDiskFarmId {
/// Exclusive lock for single disk farm info file, ensuring no concurrent edits by cooperating processes is done
#[must_use = "Lock file must be kept around or as long as farm is used"]
pub struct SingleDiskFarmInfoLock {
file: File,
}

impl Drop for SingleDiskFarmInfoLock {
fn drop(&mut self) {
use fs4::FileExt;

if let Err(error) = self.file.unlock() {
error!(%error, "Failed to unlock single disk farm lock");
}
}
_file: File,
}

/// Important information about the contents of the `SingleDiskFarm`
Expand Down Expand Up @@ -184,7 +174,7 @@ impl SingleDiskFarmInfo {
let file = File::open(directory.join(Self::FILE_NAME))?;
fs4::FileExt::try_lock_exclusive(&file)?;

Ok(SingleDiskFarmInfoLock { file })
Ok(SingleDiskFarmInfoLock { _file: file })
}

// ID of the farm
Expand Down

0 comments on commit e3daa7c

Please sign in to comment.