This function is a duplicate of `shots_delete()`. If you check out how that function works, you'll notice that it takes shot ids (one or many) as a POST argument. That function also takes care of deleting any existing job related to that shot.
I recommend removing this function and any reference to it.