[core] Prevent starting two sessions with the same name #314

This commit is contained in:
allburov committed 2024-05-04 12:24:58 +07:00
1 parent b982640c85
commit f5bd74dfa1
1 file changed
+5
+5
View File
@@ -105,6 +105,11 @@ export class SessionManagerCore extends SessionManager {
//
async start(request: SessionStartRequest): Promise<SessionDTO> {
this.onlyDefault(request.name);
if (this.session) {
throw new UnprocessableEntityException(
`Session '${this.DEFAULT}' is already started.`,
);
}
const name = request.name;
this.log.log(`'${name}' - starting session...`);