The man, who was intoxicated, was holding two large knives and waving them around, threatening to harm himself and others. Officers had him confined to a vestibule and tried to talk him repeatedly into dropping the knives.
Eventually they opened up the door and he came charging out swinging the knives.
One officer fired a Taser at him as he repeatedly lunged at another officer with the knives even as the electric current shocked his body.
The officers were able to get the man onto the ground and under control and disarm him without serious injury.
The suspect, identified as Tony Buttigieg, 36, from Caerleon, Wales, was initially charged with attempted murder of the officer for the October 2017 incident.
He pleaded guilty to a charge of attempted grievous bodily harm and this week he was sentenced to four years in prison.