set the api page size. use 250 by default since windows will have more memory available to it

This commit is contained in:
dovholuknf
2022-01-17 16:35:20 -05:00
parent cd2e01d944
commit d778e23997
7 changed files with 17 additions and 11 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
SET REPO_URL=https://github.com/openziti/ziti-tunnel-sdk-c.git
SET ZITI_TUNNEL_REPO_BRANCH=v0.15.21
SET ZITI_TUNNEL_REPO_BRANCH=v0.15.22
REM override the c sdk used in the build - leave blank for the same as specified in the tunneler sdk
SET ZITI_SDK_C_BRANCH=
REM the number of TCP connections the tunneler sdk can have at any one time
+2 -2
View File
@@ -798,7 +798,7 @@ func zitiError(code C.int) error {
return nil
}
func LoadZiti(zid *ZIdentity, cfg string, refreshInterval int) {
func LoadZiti(zid *ZIdentity, cfg string, refreshInterval int, apiPageSize int) {
zid.Options.config = C.CString(cfg)
zid.Options.refresh_interval = C.long(refreshInterval)
zid.Options.metrics_type = C.INSTANT
@@ -807,7 +807,7 @@ func LoadZiti(zid *ZIdentity, cfg string, refreshInterval int) {
zid.Options.pq_mac_cb = C.ziti_pq_mac_cb(C.ziti_pq_mac_go)
zid.Options.pq_os_cb = C.ziti_pq_os_cb(C.ziti_pq_os_go)
zid.Options.pq_process_cb = C.ziti_pq_process_cb(C.ziti_pq_process_go)
zid.Options.api_page_size = C.uint32_t(apiPageSize)
zid.Options.events = C.ZitiContextEvent | C.ZitiServiceEvent | C.ZitiRouterEvent | C.ZitiMfaAuthEvent
zid.Options.event_cb = C.ziti_event_cb(C.eventCB)
+2
View File
@@ -28,4 +28,6 @@ const (
MfaAllSvcTimeout = 0
MfaFewSvcTimeout = 1
MfaNearingTimeout = 2
DefaultApiPageSize = 250
)
+3 -3
View File
@@ -90,8 +90,7 @@ type Identity struct {
MfaMaxTimeoutRem int32
MfaLastUpdatedTime time.Time
ServiceUpdatedTime time.Time
Notified bool
Notified bool
}
type Metrics struct {
Up int64
@@ -134,6 +133,7 @@ type TunnelStatus struct {
Status string
AddDns bool
NotificationFrequency int
ApiPageSize int
}
type ServiceVersion struct {
@@ -203,5 +203,5 @@ type MfaResponse struct {
type ControllerEvent struct {
ActionEvent
Fingerprint string
Fingerprint string
}
+5 -3
View File
@@ -78,9 +78,12 @@ func SubMain(ops chan string, changes chan<- svc.Status, winEvents <-chan Window
rts.state.LogLevel = parsedLevel.String()
logging.InitLogger(parsedLevel)
_ = logging.Elog.Info(InformationEvent, SvcName+" starting. log file located at "+config.LogFile())
if rts.state.ApiPageSize < 25 { //don't allow values less than 25
rts.state.ApiPageSize = constants.DefaultApiPageSize
}
// create a channel for notifying any connections that they are to be interrupted
interrupt = make(chan struct{}, 8)
@@ -1147,7 +1150,7 @@ func handleBulkServiceChange(sc cziti.BulkServiceChange) {
if id != nil {
var m = dto.IdentityEvent{
ActionEvent: dto.IdentityUpdateComplete,
Id: Clean(id),
Id: Clean(id),
}
rts.BroadcastEvent(m)
}
@@ -1443,4 +1446,3 @@ func updateNotificationFrequency(out *json.Encoder, notificationFreq int) {
respond(out, dto.Response{Message: "Notification frequency is set", Code: SUCCESS, Error: "", Payload: ""})
}
+3 -1
View File
@@ -130,6 +130,7 @@ func (t *RuntimeState) ToStatus(onlyInitialized bool) dto.TunnelStatus {
TunIpv4Mask: t.state.TunIpv4Mask,
AddDns: t.state.AddDns,
NotificationFrequency: t.state.NotificationFrequency,
ApiPageSize: t.state.ApiPageSize,
}
i := 0
@@ -305,7 +306,8 @@ func (t *RuntimeState) LoadIdentity(id *Id, refreshInterval int) {
id.CId = cziti.NewZid(sc)
id.CId.Active = id.Active
cziti.LoadZiti(id.CId, id.Path(), refreshInterval)
log.Debugf("Default API PAGE SIZE set to: %d", rts.state.ApiPageSize)
cziti.LoadZiti(id.CId, id.Path(), refreshInterval, rts.state.ApiPageSize)
}
func (t *RuntimeState) LoadConfig() {
+1 -1
View File
@@ -1 +1 @@
1.10.10
1.10.10.1