Changed dynamic order example to use a Join and the new API.
This commit is contained in:
1 parent
85b6103944
commit
992b64c08a
8 files changed
+355
-358
No files matched your search
@@ -1,14 +1,14 @@
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/orderman/actors/order_manager/OrderBuilder.h"
|
||||
#include "lib/utils/PBUtils.h"
|
||||
#include "lib/plugin/SparkServices.h"
|
||||
#include "lib/utils/PBUtils.h"
|
||||
#include "lib/config/config.h"
|
||||
#include "lib/config/protos/system.pb.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <boost/dll.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
|
||||
namespace bts {
|
||||
namespace plugin {
|
||||
|
||||
@@ -16,8 +16,10 @@ using namespace bts::orderman;
|
||||
|
||||
void init_plugins(SparkServices &services) {
|
||||
|
||||
static std::vector<decltype (boost::dll::import<void (SparkServices&)>(boost::filesystem::path(),""))> keep_alive;
|
||||
|
||||
static std::vector<decltype(boost::dll::import<void(SparkServices &)>(
|
||||
boost::filesystem::path(), ""))>
|
||||
keep_alive;
|
||||
|
||||
auto plugin_path = os::sparkd_wd() + "/plugins/";
|
||||
if (!boost::filesystem::is_directory(plugin_path)) {
|
||||
LOG(Plugin, Info,
|
||||
@@ -32,6 +34,15 @@ void init_plugins(SparkServices &services) {
|
||||
auto &f = *iter;
|
||||
|
||||
auto pl = f.path().string();
|
||||
|
||||
if (pl == "order_plugin_example.so" &&
|
||||
config::get<config::DeploymentType>().type() != "dev") {
|
||||
LOG(Plugin, Info,
|
||||
"Skipping order_plugin_example.so because we are not running in dev mode",
|
||||
plugin_path);
|
||||
continue;
|
||||
}
|
||||
|
||||
LOG(Plugin, Info, "Attempting to initialize plugin {}", pl);
|
||||
try {
|
||||
auto init_plugin = boost::dll::import<void(SparkServices &)>(
|
||||
|
||||
Reference in new issue
Block a user