|
@@ -2,6 +2,7 @@ package service |
|
@@ -2,6 +2,7 @@ package service |
2
|
|
2
|
|
3
|
import (
|
3
|
import (
|
4
|
"fmt"
|
4
|
"fmt"
|
|
|
5
|
+ "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/xredis"
|
5
|
"strconv"
|
6
|
"strconv"
|
6
|
"strings"
|
7
|
"strings"
|
7
|
"time"
|
8
|
"time"
|
|
@@ -501,6 +502,15 @@ func (rs *EvaluationProjectService) List(in *command.QueryProjectCommand) (inter |
|
@@ -501,6 +502,15 @@ func (rs *EvaluationProjectService) List(in *command.QueryProjectCommand) (inter |
501
|
}
|
502
|
}
|
502
|
|
503
|
|
503
|
func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand) (interface{}, error) {
|
504
|
func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand) (interface{}, error) {
|
|
|
505
|
+ lock := xredis.NewLockProjectId(int(in.Id))
|
|
|
506
|
+ err := lock.Lock()
|
|
|
507
|
+ if err != nil {
|
|
|
508
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
509
|
+ }
|
|
|
510
|
+ defer func() {
|
|
|
511
|
+ lock.UnLock()
|
|
|
512
|
+ }()
|
|
|
513
|
+
|
504
|
transactionContext, err := factory.ValidateStartTransaction(in)
|
514
|
transactionContext, err := factory.ValidateStartTransaction(in)
|
505
|
if err != nil {
|
515
|
if err != nil {
|
506
|
return nil, err
|
516
|
return nil, err
|