Move relay periodic events out of mainloop.c
issue