> but at the time the code seemed completely correct to me It always does. > Well, it teaches me to do more diverse tests when doing destructive operations. Or add some logging and do a dry run and check the results, literally simple prints statements: print("-----") print("Downloading videos ids from url: {url}") print(list of ids) ... ... ... # delete() dangerous action commented out until I'm sure it's right print…
Yes. Also, maybe not have a delete action in the middle of a script. It's usually better to build a list of items to be deleted. In that case, two lists: items to be deleted, items to be kept. Then compare the lists: - make sure the sum of their lengths == number of total current items - make sure items_to_be_kept.length != 0 - make sure no two items appear in both lists - check some items chosen at random to see if…
I Accidentally Deleted 7TB of Videos Before Going to Production
71–80 of 362 posts
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#72> but at the time the code seemed completely correct to me It always does. > Well, it teaches me to do more diverse tests when doing destructive operations. Or add some logging and do a dry run and check the results, literally simple prints statements: print("-----") print("Downloading videos ids from url: {url}") print(list of ids) ... ... ... # delete() dangerous action commented out until I'm sure it's right print…
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#73Earlier quoted context omitted.
Deleting * may not be though. Your selection needs to be idempotent.
idempotency means that f(X) = f(f(X)). Modifying the X inbetween is not allowed. Is there really an initial environment where rm * ; rm * ; does something different than rm * once?
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#74Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#75Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#76Earlier quoted context omitted.
Deleting * may not be though. Your selection needs to be idempotent.
idempotency means that f(X) = f(f(X)). Modifying the X inbetween is not allowed. Is there really an initial environment where rm * ; rm * ; does something different than rm * once?
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#77It's like the first time you run rm -rf /path/to/delete/ * And realize it is taking too long...
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#78Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#79Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#80"What does this teach us? Well, it teaches me to do more diverse tests when doing destructive operations. It also should probably teach something to Vimeo and to my contractor but I doubt it will (and yes, the upload for some reason is still manual to this day. Go figure!)" So you wrote bad code, didn't test it properly, ran it on production on the Friday before a release and are blaming Vimeo and [name redacted]? An…
‘Judgment comes from experience, and experience comes from poor judgment.’
:-)