[deleted]
You're right and I edited the company's name (might be too late but better this way). That said I'm not very happy with the experience of working for TheCompanyTM anyways so I'm in the process of switching jobs. Thanks for the comment :)
I Accidentally Deleted 7TB of Videos Before Going to Production
31–40 of 362 posts
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#32Don't write a blog post.
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#33Under NDA but I'll give rough details of what's occurring while also naming my client and disparaging them to the public. Well that's a brave move...
They said they are a junior developer with not much experience. I'm afraid they may not know what is and isn't covered under NDA.
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#34Earlier quoted context omitted.
Where do you see the clients name? I only see Vimeo being mentioned.
It has been edited. https://news.ycombinator.com/item?id=31271836
It's a bit different to share a fun story a few years later about that time you almost wiped production.
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#35A friendly team will harness that enthusiasm and tame the quickness / encourage respect for production. We all made a massive doo doo and its how you proceed that'll define your career.
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#36It also makes it more testable. Instead of putting the delete call right in the loop, split it into four functions.
function getAllVimeoVideos()
function getAllDbVideos()
function getVideosToDelete(vimeo_videos, db_videos)
function deleteVideos(videos_to_delete)
Your core logic lives in getVideosToDelete which is simply a set difference.Given that there are only a few hundred videos, it is easy to run the getter functions above and quickly verify they are returning what you expect.
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#37> 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
#38[deleted]
You're right and I edited the company's name (might be too late but better this way). That said I'm not very happy with the experience of working for TheCompanyTM anyways so I'm in the process of switching jobs. Thanks for the comment :)
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#39> 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
#40One of the best things about HN is that so many incredible, talented people post. It's incredibly inspiring to raise your own game, to see what the best are doing. But sometimes it's equally important to realise we all fuck up, and for every unicorn dev there's another thousand of us grinding away.
OP - well done for sorting the problem and telling us all about it!