Skip to content

DB 트랜잭션 관련 #29

@kwonkwonn

Description

@kwonkwonn

err := service.UpdateVMStatusInRedis(ctx, c.rdb, req.UUID, normalizedStatus, time.Now().Unix())

<-- 해당 부분처럼 api 에서 redis 트랜잭션을 만든다거나

tx, err := contextStructure.DB.Begin()

<-- structure 라는 폴더에서 모든 db 트랜젝션을 하는 것 같은데
모델 분리/이름 변경등과, repositor 별로 묶으면 읽기 좀 더 쉬울것 같아요(ip 계산 로직도 다른 곳에 두는게 나을것 같네요)

또 평문 transaction 도 좋지만 Orm 도 한번 고려해보면 좋을 것 같아요.
둘다 괜찮지만 따로 이유가 있었다면 알려주세용.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions