To add a mechanism for updating all issue comments after a code change, introduce a HASH_EPOCH constant which gets mixed into the stable hash for each issue. Changing this value will force all issue comments to be updated.
This commit is contained in:
parent
da085da38f
commit
77d7d3aef6
1 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,8 @@ use std::collections::BTreeMap;
|
||||||
|
|
||||||
use petgraph::visit::EdgeRef as _;
|
use petgraph::visit::EdgeRef as _;
|
||||||
|
|
||||||
|
const HASH_EPOCH: u32 = 0x00000001;
|
||||||
|
|
||||||
/// Element in the techtree
|
/// Element in the techtree
|
||||||
#[derive(Debug, Clone, Hash, PartialEq, Eq, serde::Serialize)]
|
#[derive(Debug, Clone, Hash, PartialEq, Eq, serde::Serialize)]
|
||||||
pub struct Element {
|
pub struct Element {
|
||||||
|
@ -420,7 +422,7 @@ impl<'a> Subtree<'a> {
|
||||||
.collect();
|
.collect();
|
||||||
edges.sort();
|
edges.sort();
|
||||||
|
|
||||||
let json_data = serde_json::ser::to_string(&(nodes, edges)).unwrap();
|
let json_data = serde_json::ser::to_string(&(nodes, edges, HASH_EPOCH)).unwrap();
|
||||||
sha256::digest(json_data)
|
sha256::digest(json_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue