|
31 | 31 | #include <filesystem> |
32 | 32 | #include <future> |
33 | 33 | #include <map> |
| 34 | +#include <memory> |
| 35 | +#include <optional> |
| 36 | +#include <string> |
34 | 37 | #include <thread> |
35 | | -#include <unordered_set> |
| 38 | +#include <utility> |
| 39 | +#include <vector> |
36 | 40 |
|
37 | 41 | #include "piper.looper.hh" |
38 | 42 |
|
|
43 | 47 | #include "base/date_time_scanner.hh" |
44 | 48 | #include "base/fs_util.hh" |
45 | 49 | #include "base/injector.hh" |
| 50 | +#include "base/lnav.console.hh" |
| 51 | +#include "base/lnav_log.hh" |
46 | 52 | #include "base/piper.file.hh" |
47 | 53 | #include "base/time_util.hh" |
48 | 54 | #include "config.h" |
@@ -184,8 +190,9 @@ demux_json_string(yajlpp_parse_context* ypc, |
184 | 190 | auto* dju = static_cast<demux_json_userdata*>(ypc->ypc_userdata); |
185 | 191 | auto path_sf = ypc->get_path_as_string_fragment(); |
186 | 192 | auto value_sf = string_fragment::from_bytes(str, len); |
187 | | - if (str < dju->dju_input.udata() || |
188 | | - dju->dju_input.udata() + dju->dju_input.length() < str) { |
| 193 | + if (str < dju->dju_input.udata() |
| 194 | + || dju->dju_input.udata() + dju->dju_input.length() < str) |
| 195 | + { |
189 | 196 | value_sf = value_sf.to_owned(*dju->dju_arena); |
190 | 197 | } |
191 | 198 |
|
@@ -941,9 +948,10 @@ cleanup() |
941 | 948 | for (const auto& entry : |
942 | 949 | std::filesystem::directory_iterator(cache_subdir, ec)) |
943 | 950 | { |
944 | | - auto mtime = std::filesystem::last_write_time(entry.path()); |
945 | | - auto exp_time = mtime + cfg.c_ttl; |
946 | | - if (now < exp_time) { |
| 951 | + auto entry_mtime |
| 952 | + = std::filesystem::last_write_time(entry.path()); |
| 953 | + auto entry_exp_time = entry_mtime + cfg.c_ttl; |
| 954 | + if (now < entry_exp_time) { |
947 | 955 | is_recent = true; |
948 | 956 | break; |
949 | 957 | } |
|
0 commit comments