Fix snapshotProcessor initiation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d4dddc0df3
commit
801b082785
1 changed files with 19 additions and 15 deletions
|
@ -26,6 +26,25 @@ import (
|
|||
"github.com/rosti-cz/node-api/node"
|
||||
)
|
||||
|
||||
var snapshotProcessor apps.SnapshotProcessor
|
||||
|
||||
func init() {
|
||||
// Prepare snapshot processor
|
||||
snapshotProcessor = apps.SnapshotProcessor{
|
||||
AppsPath: config.AppsPath,
|
||||
TmpSnapshotPath: config.SnapshotsPath,
|
||||
IndexLabel: config.SnapshotsIndexLabel,
|
||||
|
||||
Driver: drivers.S3Driver{
|
||||
S3AccessKey: config.SnapshotsS3AccessKey,
|
||||
S3SecretKey: config.SnapshotsS3SecretKey,
|
||||
S3Endpoint: config.SnapshotsS3Endpoint,
|
||||
S3SSL: config.SnapshotsS3SSL,
|
||||
Bucket: config.SnapshotsS3Bucket,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// This handler only passes messages to another function for easier testing
|
||||
func messageHandler(msg *nats.Msg) {
|
||||
go _messageHandler(msg)
|
||||
|
@ -88,21 +107,6 @@ func _messageHandler(m *nats.Msg) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Prepare snapshot processor
|
||||
var snapshotProcessor apps.SnapshotProcessor = apps.SnapshotProcessor{
|
||||
AppsPath: config.AppsPath,
|
||||
TmpSnapshotPath: config.SnapshotsPath,
|
||||
IndexLabel: config.SnapshotsIndexLabel,
|
||||
|
||||
Driver: drivers.S3Driver{
|
||||
S3AccessKey: config.SnapshotsS3AccessKey,
|
||||
S3SecretKey: config.SnapshotsS3SecretKey,
|
||||
S3Endpoint: config.SnapshotsS3Endpoint,
|
||||
S3SSL: config.SnapshotsS3SSL,
|
||||
Bucket: config.SnapshotsS3Bucket,
|
||||
},
|
||||
}
|
||||
|
||||
// Returns list of apps
|
||||
func listEventHandler(m *nats.Msg, message *RequestMessage) error {
|
||||
log.Println("> List")
|
||||
|
|
Loading…
Reference in a new issue