mirror of
https://github.com/DeBrosOfficial/network.git
synced 2026-01-30 06:53:03 +00:00
feat: disable debug logging in Rqlite MCP server to reduce disk writes
- Commented out debug logging statements in the Rqlite MCP server to prevent excessive disk writes during operation. - Added a new PubSubAdapter method in the client for direct access to the pubsub.ClientAdapter, bypassing authentication checks for serverless functions. - Integrated the pubsub adapter into the gateway for serverless function support. - Implemented a new pubsub_publish host function in the serverless engine for publishing messages to topics.
This commit is contained in:
parent
fff665374f
commit
6f4f55f669
@ -136,6 +136,28 @@ func (m *MockHostServices) CacheDelete(ctx context.Context, key string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *MockHostServices) CacheIncr(ctx context.Context, key string) (int64, error) {
|
||||||
|
return m.CacheIncrBy(ctx, key, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MockHostServices) CacheIncrBy(ctx context.Context, key string, delta int64) (int64, error) {
|
||||||
|
m.mu.Lock()
|
||||||
|
defer m.mu.Unlock()
|
||||||
|
|
||||||
|
var currentValue int64
|
||||||
|
if val, ok := m.cache[key]; ok {
|
||||||
|
var err error
|
||||||
|
currentValue, err = parseInt64FromBytes(val)
|
||||||
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("value is not numeric")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
newValue := currentValue + delta
|
||||||
|
m.cache[key] = []byte(fmt.Sprintf("%d", newValue))
|
||||||
|
return newValue, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (m *MockHostServices) StoragePut(ctx context.Context, data []byte) (string, error) {
|
func (m *MockHostServices) StoragePut(ctx context.Context, data []byte) (string, error) {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user