Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
86c45bc2
Commit
86c45bc2
authored
Jun 09, 2018
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fixes in UHelper.h
parent
486df15e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
DBServer_PostgreSQL.cc
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.cc
+8
-1
DBServer_PostgreSQL.h
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.h
+4
-0
UHelpers.h
include/UHelpers.h
+1
-0
No files found.
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.cc
View file @
86c45bc2
...
...
@@ -222,7 +222,7 @@ void DBServer_PostgreSQL::flushInsertBuffer()
dbinfo
<<
myname
<<
"(flushInsertBuffer): write insert buffer["
<<
ibufSize
<<
"] to DB.."
<<
endl
;
if
(
!
db
->
copy
(
"main_history"
,
tblcols
,
ibuf
)
)
if
(
!
writeBufferToDB
(
"main_history"
,
tblcols
,
ibuf
)
)
{
dbcrit
<<
myname
<<
"(flushInsertBuffer): error: "
<<
db
->
error
()
<<
endl
;
}
...
...
@@ -233,6 +233,13 @@ void DBServer_PostgreSQL::flushInsertBuffer()
}
}
//--------------------------------------------------------------------------------------------
bool
DBServer_PostgreSQL
::
writeBufferToDB
(
const
std
::
string
&
tableName
,
const
std
::
vector
<
std
::
string
>&
colNames
,
DBServer_PostgreSQL
::
InsertBuffer
&
wbuf
)
{
return
db
->
copy
(
tableName
,
colNames
,
wbuf
);
}
//--------------------------------------------------------------------------------------------
void
DBServer_PostgreSQL
::
sensorInfo
(
const
uniset
::
SensorMessage
*
si
)
{
try
...
...
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.h
View file @
86c45bc2
...
...
@@ -129,6 +129,10 @@ namespace uniset
size_t
ibufMaxSize
=
{
2000
};
timeout_t
ibufSyncTimeout
=
{
15000
};
void
flushInsertBuffer
();
virtual
bool
writeBufferToDB
(
const
std
::
string
&
table
,
const
std
::
vector
<
std
::
string
>&
colname
,
InsertBuffer
&
ibuf
);
float
ibufOverflowCleanFactor
=
{
0
.
5
};
// коэфициент {0...1} чистки буфера при переполнении
private
:
...
...
include/UHelpers.h
View file @
86c45bc2
...
...
@@ -18,6 +18,7 @@
#define UHelpers_H_
// --------------------------------------------------------------------------
#include "UniSetTypes.h"
#include "Exceptions.h"
#include "Configuration.h"
// --------------------------------------------------------------------------
namespace
uniset
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment