First of all, we have to understand what swollen glands are. These glands or lymph nodes are part of our lymphoid system, including lymph vessels, the tonsils, the thymus, and the spleen. It includes all the cells, tissues and components which contain aggregates of lymphocytes. At the same time, they all are part of our immune system too. As part of immune system, they will fight against foreign matters and help protect our bodies. This is exact explanation to your situation. Because you got eye infection, the swollen eyes is the response to your infection made by immune system. You don't need to worry too much about it. It is how the immune system working. Yet if there is some other symptoms develop such as night sweat, persistent fever, unexplained weight loss and so on, then there might be some other serious condition which caused your swollen glands. In this case, you need to go to see a doctor for professional help at your earliest.