releaseLock method

Future<void> releaseLock()

Releases the update lock if it is held by this process.

Implementation

Future<void> releaseLock() async {
  final lockPath = lockFilePath;
  try {
    final lockFile = File(lockPath);
    if (!lockFile.existsSync()) return;
    final lockData = lockFile.readAsStringSync();
    if (lockData == '$pid') {
      lockFile.deleteSync();
    }
  } on FileSystemException {
    // Ignore errors during lock release
  }
}