This commit is contained in:
1
.vscode/launch.json
vendored
1
.vscode/launch.json
vendored
@@ -47,6 +47,7 @@
|
|||||||
"AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;CommandTimeout=120;",
|
"AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;CommandTimeout=120;",
|
||||||
"AYANOVA_DATA_PATH": "c:\\temp\\ravendata",
|
"AYANOVA_DATA_PATH": "c:\\temp\\ravendata",
|
||||||
"AYANOVA_USE_URLS": "http://*:7575;",
|
"AYANOVA_USE_URLS": "http://*:7575;",
|
||||||
|
//"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true",
|
||||||
"AYANOVA_SERVER_TEST_MODE": "false",
|
"AYANOVA_SERVER_TEST_MODE": "false",
|
||||||
//"AYANOVA_REPORT_RENDERING_TIMEOUT":"60",
|
//"AYANOVA_REPORT_RENDERING_TIMEOUT":"60",
|
||||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ namespace AyaNova.Api.Controllers
|
|||||||
[HttpGet("{logname}")]
|
[HttpGet("{logname}")]
|
||||||
public ActionResult GetLog([FromRoute] string logname)
|
public ActionResult GetLog([FromRoute] string logname)
|
||||||
{
|
{
|
||||||
if (serverState.IsClosed)
|
// if (serverState.IsClosed)
|
||||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
// return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.LogFile))
|
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.LogFile))
|
||||||
{
|
{
|
||||||
@@ -93,8 +93,8 @@ namespace AyaNova.Api.Controllers
|
|||||||
[HttpGet()]
|
[HttpGet()]
|
||||||
public ActionResult ListLogs()
|
public ActionResult ListLogs()
|
||||||
{
|
{
|
||||||
if (serverState.IsClosed)
|
// if (serverState.IsClosed)
|
||||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
// return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.LogFile))
|
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.LogFile))
|
||||||
{
|
{
|
||||||
@@ -126,8 +126,8 @@ namespace AyaNova.Api.Controllers
|
|||||||
[HttpGet("download/{logname}")]
|
[HttpGet("download/{logname}")]
|
||||||
public async Task<IActionResult> DownloadLog([FromRoute] string logname, [FromQuery] string t)
|
public async Task<IActionResult> DownloadLog([FromRoute] string logname, [FromQuery] string t)
|
||||||
{
|
{
|
||||||
if (serverState.IsClosed)
|
// if (serverState.IsClosed)
|
||||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
// return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
return BadRequest(new ApiErrorResponse(ModelState));
|
return BadRequest(new ApiErrorResponse(ModelState));
|
||||||
|
|||||||
@@ -542,7 +542,7 @@ namespace AyaNova
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_newLog.LogWarning("AYANOVA_PERMANENTLY_ERASE_DATABASE, dropping and recreating database");
|
_newLog.LogWarning("AYANOVA_PERMANENTLY_ERASE_DATABASE has been set - deleting and recreating database");
|
||||||
}
|
}
|
||||||
Util.DbUtil.DropAndRecreateDbAsync(_newLog).Wait();
|
Util.DbUtil.DropAndRecreateDbAsync(_newLog).Wait();
|
||||||
AySchema.CheckAndUpdateAsync(dbContext, _newLog).Wait();
|
AySchema.CheckAndUpdateAsync(dbContext, _newLog).Wait();
|
||||||
|
|||||||
Reference in New Issue
Block a user