Fixed infinite path mapping loop between dsnas1 and dsnas2
- Added path detection to prevent recursive analysis of paths already in destination format - Added special handling for same logical path on different mounts - Added early exit in process_copy for identical source and destination paths 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -191,6 +191,17 @@ main() {
|
||||
local dst
|
||||
dst=$(get_destination "${dir}")
|
||||
|
||||
# Detect same-path mappings (different mounts)
|
||||
if [[ "${dir}" != "${dst}" && "${dir}" =~ ^/mnt/dsnas2/ && "${dst}" =~ ^/mnt/dsnas1/ ]]; then
|
||||
local dir_suffix="${dir#/mnt/dsnas2/}"
|
||||
local dst_suffix="${dst#/mnt/dsnas1/}"
|
||||
if [[ "${dir_suffix}" == "${dst_suffix}" ]]; then
|
||||
log_info "Source and destination are the same logical location with different mounts: ${dir_suffix}"
|
||||
mark_processed "${hash}"
|
||||
continue # Skip to next torrent
|
||||
fi
|
||||
fi
|
||||
|
||||
# Initialize warned_dirs for this directory if needed
|
||||
if [[ -n "${dir}" ]]; then
|
||||
[[ -z "${warned_dirs["${dir}"]+x}" ]] && warned_dirs["${dir}"]=0
|
||||
|
||||
Reference in New Issue
Block a user