Skip to content

Commit

Permalink
refactor(interactive): Order procedures by default based on creation …
Browse files Browse the repository at this point in the history
…time. (#4059)

Order procedures by default based on creation time.
  • Loading branch information
zhanglei1949 authored Jul 18, 2024
1 parent 85cb032 commit 2fced83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions flex/engines/http_server/workdir_manipulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ gs::Result<bool> 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) {
Expand Down Expand Up @@ -525,7 +526,9 @@ gs::Result<seastar::sstring> WorkDirManipulator::UpdateProcedure(
auto new_description = json["description"];
VLOG(10) << "Update description: "
<< new_description; // update description
plugin_node["description"] = new_description.get<std::string>();
// quote the description, since it may contain space.
plugin_node["description"] =
"\"" + new_description.get<std::string>() + "\"";
}

bool enabled;
Expand Down
5 changes: 5 additions & 0 deletions flex/storages/metadata/default_graph_meta_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ Result<std::vector<PluginMeta>> 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<std::vector<PluginMeta>>(metas);
}

Expand Down

0 comments on commit 2fced83

Please sign in to comment.