basho/yokozuna — pull request #311 by rzezeski (2014-02-18 22:46:26+00:00)
Title: Update previous hash during event tick + general refactoring

Currently `yz_events:sync_indexes` is called on every tick because the previous hash is not being updated. I noticed this when investigating #304.

* Sync indexes IFF full check or hash has changed.
* Fix off-by-one error in full check.
* Add `MAYBE` macro for tighter code.

This can be verified by using redbug to verify `sync_indexes` is called every 60 seconds.

```
> redbug:start("yz_events:sync_indexes -> return", [{time, 180000}]).
```