mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 16:33:53 +01:00
ircd:Ⓜ️:events: Use event_json column for dump.
This commit is contained in:
parent
47df2bc4e2
commit
7a5bb70f16
1 changed files with 18 additions and 7 deletions
|
@ -104,17 +104,30 @@ ircd::m::events::dump__file(const string_view &filename)
|
|||
|
||||
char *pos{data(buf)};
|
||||
size_t foff{0}, ecount{0}, acount{0}, errcount{0};
|
||||
for_each(m::event::idx{0}, [&]
|
||||
(const event::idx &seq, const m::event &event)
|
||||
for(auto it(begin(dbs::event_json)); it; ++it)
|
||||
{
|
||||
const event::idx seq
|
||||
{
|
||||
byte_view<uint64_t>(it->first)
|
||||
};
|
||||
|
||||
const string_view source
|
||||
{
|
||||
it->second
|
||||
};
|
||||
|
||||
const auto remain
|
||||
{
|
||||
size_t(data(buf) + size(buf) - pos)
|
||||
};
|
||||
|
||||
assert(remain >= event::MAX_SIZE && remain <= size(buf));
|
||||
const mutable_buffer mb{pos, remain};
|
||||
pos += copy(mb, event.source);
|
||||
const mutable_buffer mb
|
||||
{
|
||||
pos, remain
|
||||
};
|
||||
|
||||
pos += copy(mb, source);
|
||||
++ecount;
|
||||
if(pos + event::MAX_SIZE > data(buf) + size(buf))
|
||||
{
|
||||
|
@ -142,9 +155,7 @@ ircd::m::events::dump__file(const string_view &filename)
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
if(pos > data(buf))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue