fix: fix passing scripts (#1170)

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
Vladislav 2023-05-01 22:14:44 +03:00 committed by GitHub
parent c2af5b0de1
commit 0bfca475cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -430,7 +430,10 @@ void DflyCmd::FullSyncFb(FlowInfo* flow, Context* cntx) {
auto scripts = sf_->script_mgr()->GetAll();
StringVec script_bodies;
for (auto& [sha, data] : scripts) {
script_bodies.push_back(move(data.orig_body));
// Always send original body (with header & without auto async calls) that determines the sha,
// It's stored only if it's different from the post-processed version.
string& body = data.orig_body.empty() ? data.body : data.orig_body;
script_bodies.push_back(move(body));
}
ec = saver->SaveHeader(script_bodies);
} else {