Closed SeanDS closed 6 years ago
You're right, I didn't consider that targets could be re-used. (I set these flags as kind of paranoia guard.) Targets aren't thread safe either, maybe they should be locked by the synchronizer and the flags be reset after use...
If I create:
then use these targets for both an upload and a download synchronizer:
this leads to the following error on the
ftp_uploader.run()
line:This is because the constructors for
DownloadSynchronizer
andUploadSynchronizer
set the remote/local targets asreadonly
, respectively, without making a copy of the provided object. A simple hack to fix this is to explicitly set the local/remote targets in this case to non-readonly in between:It would probably be better if the constructor explicitly sets the read/write status of both the remote and local targets. For example, the
DownloadSynchronizer
would have: