@@ -383,7 +383,15 @@ void IcingaDB::UpdateAllConfigObjects()
383
383
upqObjectType.Enqueue ([&]() {
384
384
for (auto & hMSet : source.second ) {
385
385
for (decltype (hMSet.size ()) i = 0 , stop = hMSet.size () - 1u ; i < stop; i += 2u ) {
386
- dest.emplace (std::move (hMSet[i]), std::move (hMSet[i + 1u ]));
386
+ auto variantToString = [](RedisConnection::QueryArg v) -> String {
387
+ if (auto str (std::get_if<String>(&v.GetData ())); str) {
388
+ return std::move (*str);
389
+ }
390
+
391
+ return std::get<std::string_view>(v.GetData ());
392
+ };
393
+
394
+ dest.emplace (variantToString (std::move (hMSet[i])), variantToString (std::move (hMSet[i + 1u ])));
387
395
}
388
396
389
397
hMSet.clear ();
@@ -691,12 +699,12 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
691
699
auto id (HashValue (new Array ({m_EnvironmentId, actionUrl})));
692
700
693
701
if (runtimeUpdate || m_DumpedGlobals.ActionUrl .IsNew (id)) {
694
- actionUrls.emplace_back (std::move (id) );
702
+ actionUrls.emplace_back (id );
695
703
Dictionary::Ptr data = new Dictionary ({{" environment_id" , m_EnvironmentId}, {" action_url" , actionUrl}});
696
704
actionUrls.emplace_back (JsonEncode (data));
697
705
698
706
if (runtimeUpdate) {
699
- AddObjectDataToRuntimeUpdates (runtimeUpdates, actionUrls. at (actionUrls. size () - 2u ) , m_PrefixConfigObject + " action:url" , data);
707
+ AddObjectDataToRuntimeUpdates (runtimeUpdates, id , m_PrefixConfigObject + " action:url" , data);
700
708
}
701
709
}
702
710
}
@@ -706,12 +714,12 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
706
714
auto id (HashValue (new Array ({m_EnvironmentId, notesUrl})));
707
715
708
716
if (runtimeUpdate || m_DumpedGlobals.NotesUrl .IsNew (id)) {
709
- notesUrls.emplace_back (std::move (id) );
717
+ notesUrls.emplace_back (id );
710
718
Dictionary::Ptr data = new Dictionary ({{" environment_id" , m_EnvironmentId}, {" notes_url" , notesUrl}});
711
719
notesUrls.emplace_back (JsonEncode (data));
712
720
713
721
if (runtimeUpdate) {
714
- AddObjectDataToRuntimeUpdates (runtimeUpdates, notesUrls. at (notesUrls. size () - 2u ) , m_PrefixConfigObject + " notes:url" , data);
722
+ AddObjectDataToRuntimeUpdates (runtimeUpdates, id , m_PrefixConfigObject + " notes:url" , data);
715
723
}
716
724
}
717
725
}
@@ -721,12 +729,12 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
721
729
auto id (HashValue (new Array ({m_EnvironmentId, iconImage})));
722
730
723
731
if (runtimeUpdate || m_DumpedGlobals.IconImage .IsNew (id)) {
724
- iconImages.emplace_back (std::move (id) );
732
+ iconImages.emplace_back (id );
725
733
Dictionary::Ptr data = new Dictionary ({{" environment_id" , m_EnvironmentId}, {" icon_image" , iconImage}});
726
734
iconImages.emplace_back (JsonEncode (data));
727
735
728
736
if (runtimeUpdate) {
729
- AddObjectDataToRuntimeUpdates (runtimeUpdates, iconImages. at (iconImages. size () - 2u ) , m_PrefixConfigObject + " icon:image" , data);
737
+ AddObjectDataToRuntimeUpdates (runtimeUpdates, id , m_PrefixConfigObject + " icon:image" , data);
730
738
}
731
739
}
732
740
}
0 commit comments