From f7d2262790cb59963958eb4adac4d669e7e3c4bc Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 13 Oct 2020 16:11:39 +0200 Subject: [PATCH] Add permissions to database interfaces for improved performance --- intel/filterlists/database.go | 2 ++ profile/database.go | 5 ++++- status/database.go | 7 +++++-- updates/export.go | 7 +++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/intel/filterlists/database.go b/intel/filterlists/database.go index 23ce779e..c76fc10c 100644 --- a/intel/filterlists/database.go +++ b/intel/filterlists/database.go @@ -48,6 +48,8 @@ var ( var ( cache = database.NewInterface(&database.Options{ + Local: true, + Internal: true, CacheSize: 2 ^ 8, }) ) diff --git a/profile/database.go b/profile/database.go index 75414f1f..f5cce9d6 100644 --- a/profile/database.go +++ b/profile/database.go @@ -21,7 +21,10 @@ const ( ) var ( - profileDB = database.NewInterface(nil) + profileDB = database.NewInterface(&database.Options{ + Local: true, + Internal: true, + }) ) func makeScopedID(source, id string) string { diff --git a/status/database.go b/status/database.go index 6b89bc0f..cb8774fb 100644 --- a/status/database.go +++ b/status/database.go @@ -13,8 +13,11 @@ const ( ) var ( - statusDB = database.NewInterface(nil) - hook *database.RegisteredHook + statusDB = database.NewInterface(&database.Options{ + Local: true, + Internal: true, + }) + hook *database.RegisteredHook ) type statusHook struct { diff --git a/updates/export.go b/updates/export.go index b113819c..37872e55 100644 --- a/updates/export.go +++ b/updates/export.go @@ -20,8 +20,11 @@ const ( // working vars var ( - versionExport *versions - versionExportDB = database.NewInterface(nil) + versionExport *versions + versionExportDB = database.NewInterface(&database.Options{ + Local: true, + Internal: true, + }) versionExportHook *database.RegisteredHook )