0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-02 08:48:18 +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::object opts;
bool phased;
bool initial;
public:
string_view name() const;

View file

@ -861,6 +861,10 @@ ircd::m::sync::item::item(std::string name,
{
opts.get<bool>("phased", false)
}
,initial
{
opts.get<bool>("initial", false)
}
{
log::debug
{
@ -891,7 +895,11 @@ try
return false;
// 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;
#ifdef RB_DEBUG

View file

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