The two shooting were hours apart. By the time the second shooting began, the shooter at the first Mosque was already in custody. It's quite possible the second shooting was some kind of separate but related act.
It's unclear to me at this time, and probably will remain so.