Calling getData function in regular intervals