skygw_log_flush no longer calls logmanager_write_log.
This commit is contained in:
@ -1567,28 +1567,28 @@ int skygw_log_write_context(logfile_id_t id,
|
|||||||
|
|
||||||
int skygw_log_flush(logfile_id_t id)
|
int skygw_log_flush(logfile_id_t id)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = -1;
|
||||||
|
|
||||||
if (!logmanager_register(false))
|
if (logmanager_register(false))
|
||||||
{
|
{
|
||||||
ss_dfprintf(stderr,
|
|
||||||
"Can't register to logmanager, nothing to flush\n");
|
|
||||||
goto return_err;
|
|
||||||
}
|
|
||||||
CHK_LOGMANAGER(lm);
|
CHK_LOGMANAGER(lm);
|
||||||
err = logmanager_write_log(id,
|
|
||||||
LOG_FLUSH_YES,
|
|
||||||
0, 0, NULL);
|
|
||||||
|
|
||||||
if (err != 0)
|
if (logmanager_is_valid_id(id))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "skygw_log_flush failed.\n");
|
logfile_t *lf = logmanager_get_logfile(lm, id);
|
||||||
goto return_unregister;
|
CHK_LOGFILE(lf);
|
||||||
|
|
||||||
|
logfile_flush(lf);
|
||||||
|
err = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return_unregister:
|
|
||||||
logmanager_unregister();
|
logmanager_unregister();
|
||||||
return_err:
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ss_dfprintf(stderr, "Can't register to logmanager, flushing failed.\n");
|
||||||
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user