24 void scheduler_disconnect(
MonkState* state,
int exitval) {
25 fo_dbManager_finish(state->dbManager);
30 if(state->dbManager != NULL) {
31 scheduler_disconnect(state, exitval);
37 char* commitHash =
fo_sysconfig(agentName,
"COMMIT_HASH");
39 gchar* agentRevision = g_strdup_printf(
"%s.%s", version, commitHash);
41 int agentId =
fo_GetAgentKey(fo_dbManager_getWrappedConnection(state->dbManager),
42 agentName, 0, agentRevision, agentDesc);
43 g_free(agentRevision);
46 state->agentId = agentId;
void bail(int exitval)
Disconnect with scheduler returning an error code and exit.
void fo_scheduler_disconnect(int retcode)
Disconnect the scheduler connection.
The main FOSSology C library.
int queryAgentId(PGconn *dbConn)
Get agent id, exit if agent id is incorrect.
FUNCTION int fo_GetAgentKey(PGconn *pgConn, const char *agent_name, long Upload_pk, const char *rev, const char *agent_desc)
Get the latest enabled agent key (agent_pk) from the database.
char * fo_sysconfig(const char *sectionname, const char *variablename)
gets a system configuration variable from the configuration data.