Commit 702d80ab authored by nanahira's avatar nanahira

add lock for login

parent e26cbc81
Pipeline #17479 passed with stages
in 3 minutes and 13 seconds
This diff is collapsed.
......@@ -9,6 +9,7 @@ import { lastValueFrom } from 'rxjs';
import moment, { Moment } from 'moment';
import { S3Client } from '@aws-sdk/client-s3';
import { Upload } from '@aws-sdk/lib-storage';
import { Aragami } from 'aragami';
interface OTTResponse<T> {
code: number;
......@@ -96,7 +97,9 @@ export class OneTwoThreeService extends MiddlewareService {
token: string;
tokenExpireTime: Moment;
private async login(relogin = false) {
private aragami = new Aragami();
private async loginProcess(relogin = false) {
if (
!relogin &&
this.token &&
......@@ -121,6 +124,10 @@ export class OneTwoThreeService extends MiddlewareService {
throw new BlankReturnMessageDto(data.code, data.message).toException();
}
private async login() {
return this.aragami.lock('ott-login', () => this.loginProcess());
}
async info() {
if (!this.username) {
throw new BlankReturnMessageDto(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment