@@ -402,7 +402,15 @@ void IcingaDB::UpdateAllConfigObjects()
402
402
upqObjectType.Enqueue ([&]() {
403
403
for (auto & hMSet : source.second ) {
404
404
for (decltype (hMSet.size ()) i = 0 , stop = hMSet.size () - 1u ; i < stop; i += 2u ) {
405
- dest.emplace (std::move (hMSet[i]), std::move (hMSet[i + 1u ]));
405
+ auto variantToString = [](RedisConnection::QueryArg v) -> String {
406
+ if (auto str (std::get_if<String>(&v.GetData ())); str) {
407
+ return std::move (*str);
408
+ }
409
+
410
+ return std::get<std::string_view>(v.GetData ());
411
+ };
412
+
413
+ dest.emplace (variantToString (std::move (hMSet[i])), variantToString (std::move (hMSet[i + 1u ])));
406
414
}
407
415
408
416
hMSet.clear ();
@@ -710,12 +718,12 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
710
718
auto id (HashValue (new Array ({m_EnvironmentId, actionUrl})));
711
719
712
720
if (runtimeUpdate || m_DumpedGlobals.ActionUrl .IsNew (id)) {
713
- actionUrls.emplace_back (std::move (id) );
721
+ actionUrls.emplace_back (id );
714
722
Dictionary::Ptr data = new Dictionary ({{" environment_id" , m_EnvironmentId}, {" action_url" , actionUrl}});
715
723
actionUrls.emplace_back (JsonEncode (data));
716
724
717
725
if (runtimeUpdate) {
718
- AddObjectDataToRuntimeUpdates (runtimeUpdates, actionUrls. at (actionUrls. size () - 2u ) , m_PrefixConfigObject + " action:url" , data);
726
+ AddObjectDataToRuntimeUpdates (runtimeUpdates, id , m_PrefixConfigObject + " action:url" , data);
719
727
}
720
728
}
721
729
}
@@ -725,12 +733,12 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
725
733
auto id (HashValue (new Array ({m_EnvironmentId, notesUrl})));
726
734
727
735
if (runtimeUpdate || m_DumpedGlobals.NotesUrl .IsNew (id)) {
728
- notesUrls.emplace_back (std::move (id) );
736
+ notesUrls.emplace_back (id );
729
737
Dictionary::Ptr data = new Dictionary ({{" environment_id" , m_EnvironmentId}, {" notes_url" , notesUrl}});
730
738
notesUrls.emplace_back (JsonEncode (data));
731
739
732
740
if (runtimeUpdate) {
733
- AddObjectDataToRuntimeUpdates (runtimeUpdates, notesUrls. at (notesUrls. size () - 2u ) , m_PrefixConfigObject + " notes:url" , data);
741
+ AddObjectDataToRuntimeUpdates (runtimeUpdates, id , m_PrefixConfigObject + " notes:url" , data);
734
742
}
735
743
}
736
744
}
@@ -740,12 +748,12 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
740
748
auto id (HashValue (new Array ({m_EnvironmentId, iconImage})));
741
749
742
750
if (runtimeUpdate || m_DumpedGlobals.IconImage .IsNew (id)) {
743
- iconImages.emplace_back (std::move (id) );
751
+ iconImages.emplace_back (id );
744
752
Dictionary::Ptr data = new Dictionary ({{" environment_id" , m_EnvironmentId}, {" icon_image" , iconImage}});
745
753
iconImages.emplace_back (JsonEncode (data));
746
754
747
755
if (runtimeUpdate) {
748
- AddObjectDataToRuntimeUpdates (runtimeUpdates, iconImages. at (iconImages. size () - 2u ) , m_PrefixConfigObject + " icon:image" , data);
756
+ AddObjectDataToRuntimeUpdates (runtimeUpdates, id , m_PrefixConfigObject + " icon:image" , data);
749
757
}
750
758
}
751
759
}
0 commit comments