Solution?
Since your existing batch does what you want, no doubt testing a replacement will occupy some hours - so:
Split the 17,000 files - or those that remain unprocessed into (however many cores you have) separate directories, then start your existing batch on each directory. Since it's the weekend, leave the process running overnight. 8 cores? should be done in 15 hours or so, while you catch up on sleep or gardening or whatever.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…