0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-04 09:38:37 +02:00

ircd:Ⓜ️:sync: Add an initial phase convenience; add account_data as an initial phase.

This commit is contained in:
Jason Volk 2019-04-16 00:32:37 -07:00
parent f17e521ff8
commit 25d153d64c
3 changed files with 14 additions and 2 deletions

View file

@ -52,6 +52,7 @@ struct ircd::m::sync::item
json::strung feature; json::strung feature;
json::object opts; json::object opts;
bool phased; bool phased;
bool initial;
public: public:
string_view name() const; string_view name() const;

View file

@ -861,6 +861,10 @@ ircd::m::sync::item::item(std::string name,
{ {
opts.get<bool>("phased", false) opts.get<bool>("phased", false)
} }
,initial
{
opts.get<bool>("initial", false)
}
{ {
log::debug log::debug
{ {
@ -891,7 +895,11 @@ try
return false; return false;
// Skip the item for phased-sync ranges if it's not phased-sync aware. // Skip the item for phased-sync ranges if it's not phased-sync aware.
if(!phased && data.phased) if(data.phased && !phased && !initial)
return false;
// Skip the item for phased-sync ranges after initial sync if it has initial=true
if(data.phased && initial && int64_t(data.range.first) < 0L)
return false; return false;
#ifdef RB_DEBUG #ifdef RB_DEBUG

View file

@ -28,7 +28,10 @@ ircd::m::sync::account_data
{ {
"account_data", "account_data",
account_data_polylog, account_data_polylog,
account_data_linear account_data_linear,
{
{ "initial", true }
}
}; };
bool bool