Skip to content

Commit

Permalink
[Service] active flag from json
Browse files Browse the repository at this point in the history
1. Update 'activate' flag from json when registering new model info from res-pkg.
2. Fix log message, hide app info string.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
  • Loading branch information
jaeyun-jung committed Oct 27, 2023
1 parent 597174f commit 5f8f9e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions daemon/pkg-mgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,18 @@ _parse_model_json (const gchar *json_path, const gchar *app_info)
const gchar *name = json_object_get_string_member (object, "name");
const gchar *model = json_object_get_string_member (object, "model");
const gchar *description = json_object_get_string_member (object, "description");
const gchar *activate = json_object_get_string_member (object, "activate");

if (!name || !model || !description) {
_E ("Failed to get name, model, or description from json file '%s'", json_path);
continue;
}

guint version;
db.set_model (name, model, true, description, app_info, &version);
bool active = (activate && g_ascii_strcasecmp (activate, "true") == 0);
db.set_model (name, model, active, description, app_info, &version);

_I ("The model with app_info (%s) is registered as version %u", app_info, version);
_I ("The model with name '%s' is registered as version '%u'.", name, version);
}
} catch (const std::exception &e) {
_E ("%s", e.what ());
Expand Down

0 comments on commit 5f8f9e0

Please sign in to comment.