diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2018-01-11 17:07:50 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2018-01-17 11:50:30 +0100 |
commit | 6b3408662c9d3a4c27c6883f7bd1f88e60981094 (patch) | |
tree | d6d2f13742f935fe8ddf433f404d76a5d1353194 /tool | |
parent | dbf75dedefc7c14705538d63257d8f8cf4a594ff (diff) |
store: Periodically update keys from the network.
- Update all keys stored in a store with network policy 'encrypted'
and 'insecure' periodically using the SKS keyserver pool.
- Slightly amend the net::ipc interface so that servers can spawn
futures on the reactor.
- As a background service cannot directly communicate failures, this
patch adds a logging mechanism.
- In sq, display the key update timestamp, and the status of the
last update.
Diffstat (limited to 'tool')
-rw-r--r-- | tool/src/main.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tool/src/main.rs b/tool/src/main.rs index b7e91ca2..913139fa 100644 --- a/tool/src/main.rs +++ b/tool/src/main.rs @@ -387,14 +387,27 @@ fn real_main() -> Result<()> { ("keys", Some(_)) => { let mut table = Table::new(); table.set_format(*prettytable::format::consts::FORMAT_NO_LINESEP_WITH_TITLE); - table.set_titles(row!["fingerprint", "# of bindings"]); + table.set_titles(row!["fingerprint", "# of bindings", "updated", "status"]); for item in Store::list_keys(&ctx) .expect("Failed to iterate over keys") { + let stats = item.key.stats() + .expect("Failed to get stats"); table.add_row(Row::new(vec![ Cell::new(&item.fingerprint.to_string()), - Cell::new(&format!("{}", item.bindings))]) - ); + Cell::new(&format!("{}", item.bindings)), + if let Some(ref t) = stats.updated { + Cell::new(&sequoia_store::format_system_time(t) + .expect("Failed to format timestamp")) + } else { + Cell::new("") + }, + if let Some(m) = stats.message { + Cell::new(&m.short()) + } else { + Cell::new("") + }, + ])); } table.printstd(); |