Core flashing cyan after running fine for long periods of time

Actually I just found this; is this what you were thinking?
if (!Spark.connected())
Spark.connect();
}

From: Losing Spark.subscribe() connection/subscription