Publish what index_status reports: the strategy, the current cadence and, * when a check just completed, the wall-clock time of that scan. A non-git * root is "tree" when watch_non_git polls it (#1948), else "none". */
| 1323 | * when a check just completed, the wall-clock time of that scan. A non-git |
| 1324 | * root is "tree" when watch_non_git polls it (#1948), else "none". */ |
| 1325 | static void publish_status(project_state_t *s, bool scanned) { |
| 1326 | cbm_watcher_strategy_t strategy = CBM_WATCHER_STRATEGY_NONE; |
| 1327 | if (s->is_git) { |
| 1328 | strategy = CBM_WATCHER_STRATEGY_GIT; |
| 1329 | } else if (s->tree_poll) { |
| 1330 | strategy = CBM_WATCHER_STRATEGY_TREE; |
| 1331 | } |
| 1332 | atomic_store(&s->status_strategy, strategy); |
| 1333 | atomic_store(&s->status_interval_ms, s->interval_ms); |
| 1334 | if (scanned) { |
| 1335 | atomic_store(&s->status_last_scan_s, (int64_t)time(NULL)); |
| 1336 | } |
| 1337 | } |
| 1338 | |
| 1339 | /* Init baseline for a project: check if git, get HEAD, count files */ |
| 1340 | static bool init_baseline(cbm_watcher_t *w, project_state_t *s) { |
no outgoing calls
no test coverage detected