From 2fced83f77741941a40d0cfc04b2ee6b069be077 Mon Sep 17 00:00:00 2001 From: Zhang Lei Date: Thu, 18 Jul 2024 19:32:59 +0800 Subject: [PATCH] refactor(interactive): Order procedures by default based on creation time. (#4059) Order procedures by default based on creation time. --- flex/engines/http_server/workdir_manipulator.cc | 7 +++++-- flex/storages/metadata/default_graph_meta_store.cc | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/flex/engines/http_server/workdir_manipulator.cc b/flex/engines/http_server/workdir_manipulator.cc index 9f13005cc394..278f2c1c5dd2 100644 --- a/flex/engines/http_server/workdir_manipulator.cc +++ b/flex/engines/http_server/workdir_manipulator.cc @@ -105,7 +105,8 @@ gs::Result WorkDirManipulator::DumpGraphSchema( YAML::Node plugin_node; plugin_node["name"] = plugin.name; plugin_node["library"] = plugin.library; - plugin_node["description"] = plugin.description; + // quote the description, since it may contain space. + plugin_node["description"] = "\"" + plugin.description + "\""; if (plugin.params.size() > 0) { YAML::Node params_node; for (auto& param : plugin.params) { @@ -525,7 +526,9 @@ gs::Result WorkDirManipulator::UpdateProcedure( auto new_description = json["description"]; VLOG(10) << "Update description: " << new_description; // update description - plugin_node["description"] = new_description.get(); + // quote the description, since it may contain space. + plugin_node["description"] = + "\"" + new_description.get() + "\""; } bool enabled; diff --git a/flex/storages/metadata/default_graph_meta_store.cc b/flex/storages/metadata/default_graph_meta_store.cc index a4e0f380ce67..b2e2397945e5 100644 --- a/flex/storages/metadata/default_graph_meta_store.cc +++ b/flex/storages/metadata/default_graph_meta_store.cc @@ -150,6 +150,11 @@ Result> DefaultGraphMetaStore::GetAllPluginMeta( metas.push_back(plugin_meta); } } + // Sort the plugin metas by create time. + std::sort(metas.begin(), metas.end(), + [](const PluginMeta& a, const PluginMeta& b) { + return a.creation_time < b.creation_time; + }); return Result>(metas); }