Enemy spawners can be extremely frustrating. They keep spawning enemies into the vicinity until you get tired or are defeated. Unless of course, you are able to destroy them. However, there is another option.
Just place torches all around the spawner. Most players put one on each vertical side and on the top of the spawner, but it also works if you place them around the room, since it’s about the fact that there’s a light source present.
This is a better idea than destroying it. Torches will prevent enemies from spawning. Also, if you need to farm a certain type of enemy, you can just remove the torches to let them spawn.