saving the p1 measurement to redis
added a wait & exit function