# Cache: fix two issues with isProblematicTimestamp · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/72ee042ab0c6dc823f839bca6d1511a144f62b49)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 72ee042ab0c6dc823f839bca6d1511a144f62b49

Requested commit: 72ee042ab0c6dc823f839bca6d1511a144f62b49

Commit: 72ee042ab0c6dc823f839bca6d1511a144f62b49

Tree: 1ff98cf9f458f97a897758441e9f64338e5e2220

Author: Travis Martin

Committer: Andrew Kelley

## Message

```
Cache: fix two issues with isProblematicTimestamp

1. It was looking for trailing zero bits when it should be looking for
   trailing decimal zeros.
2. Clock timestamps had more precision than the actual file timestamps

The fix is to grab a timestamp from a 'just now changed' temp file.
This timestamp is "problematic". Any file timestamp greater than or equal
to this timestamp is considered problematic. File timestamps **prior** to
this **can** be trusted.

Downside is that it causes a disk I/O to write to and then read the
timestamp from this file ~1ms on my system. This is partially mitigated by
keeping track of the most recent problematic timestamp, and only checking
for a new problematic timestamp when checking a timestamp that is equal to
or larger than the last problematic one.

This fixes #6082.

```

## Parents

- [01cb0bdb8317484cab0f8ee3896c981c851d3bb1](https://git.cafe/gitcafe/zig/commit/01cb0bdb8317484cab0f8ee3896c981c851d3bb1?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/72ee042ab0c6dc823f839bca6d1511a144f62b49?format=markdown)
