j3k0 / ganomede-notifications

Long-pull notification service for Ganomede
0 stars 0 forks source link

Cleaning up old messages #27

Closed j3k0 closed 8 years ago

j3k0 commented 8 years ago

The push worker seems to have failed a few days ago. The database is filled with millions of meaningless messages. Is there a way to clean up messages? (only messages, not tokens).

If you have time, this is kinda urgent 🆘

elmigranto commented 8 years ago

Do you mean that process died and there are a bunch of out-of-date notifications?

elmigranto commented 8 years ago

The list of notifications to send is at key config.pushApi.notificationsPrefix, you can:

j3k0 commented 8 years ago

Not sure what happened. I've been said notifications stopped working a few days ago. Indeed, when starting the push-worker, he is processing messages dating from last wednesday.

elmigranto commented 8 years ago

Looks like messages are added to the head of the list and processed from the tail. So LTRIM 0 1000, for example, will leave you with 1000 latest notifications.

upd: it is 1001, not 1000.

j3k0 commented 8 years ago

Thanks.

For future reference:

redis-cli ltrim notifications:push-notifications 0 1000