# Harvest the latest metrics when \`/metrics\` is requested · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a85f9e74b111c65d6a3ee535ae8e08a20c664eaf)

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

Visibility: public

Requested revision: a85f9e74b111c65d6a3ee535ae8e08a20c664eaf

Requested commit: a85f9e74b111c65d6a3ee535ae8e08a20c664eaf

Commit: a85f9e74b111c65d6a3ee535ae8e08a20c664eaf

Tree: 35988b80e0d4f0fbb4e4c5e87fe59e512d2971ac

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Harvest the latest metrics when `/metrics` is requested

Now that we track active projects, if nothing happens to the store
during the activity timeout we would still serve some old metrics
that may not account for the staleness of a project.

This commit changes it so that we grab a mutable reference to the store
before serving the metrics, which has the side effect of updating
all the metrics.

```

## Parents

- [e373e05d27547c7f46d9e13482545447e06c8bd6](https://git.cafe/gitcafe/zed/commit/e373e05d27547c7f46d9e13482545447e06c8bd6?format=markdown)

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