@@ -4,18 +4,20 @@ import (
44 "context"
55 "fmt"
66
7- "github.com/PythonHacker24/linux-acl-management-backend/internal/session"
87 "go.uber.org/zap"
8+
9+ "github.com/PythonHacker24/linux-acl-management-backend/internal/session"
10+ "github.com/PythonHacker24/linux-acl-management-backend/internal/types"
911)
1012
1113/* instanciate new permission processor */
1214func NewPermProcessor () * PermProcessor {
13- return & PermProcessor {}
15+ return & PermProcessor {}
1416}
1517
1618/* processor for permissions manager */
1719func (p * PermProcessor ) Process (ctx context.Context , curSession * session.Session , tx interface {}) error {
18- transaction , ok := tx .(* Transaction )
20+ transaction , ok := tx .(* types. Transaction )
1921 if ! ok {
2022 return fmt .Errorf ("invalid transaction type" )
2123 }
@@ -24,25 +26,25 @@ func (p *PermProcessor) Process(ctx context.Context, curSession *session.Session
2426 zap .L ().Info ("Processing Transaction" ,
2527 zap .String ("user" , curSession .Username ),
2628 )
27-
29+
2830 select {
29- case <- ctx .Done ():
30- /*
31- store this into persistent storage too!
32- make sure database connections are closed after scheduler shutsdown
33- */
34- zap .L ().Warn ("Transaction process stopped due to shutdown" ,
35- zap .String ("user" , curSession .Username ),
36- )
37- return ctx .Err ()
38- default :
39- /*
40- permprocessor hands over transactions to remoteprocessor/localprocessor depending upon request
41- remoteprocessor -> handles permissions on remote servers
42- localprocessor -> handles permissions on local system (where this backend is deployed)
43- */
44- _ = transaction
31+ case <- ctx .Done ():
32+ /*
33+ store this into persistent storage too!
34+ make sure database connections are closed after scheduler shutsdown
35+ */
36+ zap .L ().Warn ("Transaction process stopped due to shutdown" ,
37+ zap .String ("user" , curSession .Username ),
38+ )
39+ return ctx .Err ()
40+ default :
41+ /*
42+ permprocessor hands over transactions to remoteprocessor/localprocessor depending upon request
43+ remoteprocessor -> handles permissions on remote servers
44+ localprocessor -> handles permissions on local system (where this backend is deployed)
45+ */
46+ _ = transaction
4547 }
4648
47- return nil
49+ return nil
4850}
0 commit comments