mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
ircd:Ⓜ️:sync: Add an initial phase convenience; add account_data as an initial phase.
This commit is contained in:
parent
f17e521ff8
commit
25d153d64c
3 changed files with 14 additions and 2 deletions
|
@ -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;
|
||||||
|
|
10
ircd/m.cc
10
ircd/m.cc
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue