-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(back): Jobs launch and synchronize (#55)
* feat(worker/gmail): Setup basic email sender and Docker * feat(back): google send mail reaction * fix: adjustments * fix: send_email constant unused * fix: workflow step id in python file * feat(synchronize): kill all jobs on production when starting supervisor * feat(back): synchronize jobs, first areas migration, job rename * feat(back): area workflows chained * fix(back): docker environment and synchronize killAll * fix(back): debug print in gmail py * fix: removed migration --------- Co-authored-by: Reza Rahemtola <[email protected]>
- Loading branch information
1 parent
f9ef3ea
commit 45c1960
Showing
18 changed files
with
211 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
import { Controller } from "@nestjs/common"; | ||
import { Controller, forwardRef, Inject } from "@nestjs/common"; | ||
import { GrpcMethod } from "@nestjs/microservices"; | ||
import { ApiExcludeController } from "@nestjs/swagger"; | ||
import { JobData } from "./grpc.dto"; | ||
import { JobsService } from "../jobs/jobs.service"; | ||
|
||
@ApiExcludeController() | ||
@Controller() | ||
export class GrpcController { | ||
constructor(@Inject(forwardRef(() => JobsService)) private readonly jobsService: JobsService) {} | ||
|
||
@GrpcMethod("AreaBackService", "OnAction") | ||
onAction(data: JobData): void { | ||
console.log("OnAction", data); | ||
async onAction(data: JobData): Promise<void> { | ||
await this.jobsService.launchNextJob(data); | ||
} | ||
|
||
@GrpcMethod("AreaBackService", "OnReaction") | ||
onReaction(data: JobData): void { | ||
console.log("OnReaction", data); | ||
async onReaction(data: JobData): Promise<void> { | ||
await this.jobsService.launchNextJob(data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
GO_ENV=development | ||
|
||
GRPC_SERVER_PORT=50051 | ||
|
||
GRPC_CALLBACK_HOST=localhost | ||
GRPC_CALLBACK_PORT=50050 | ||
|
||
GOOGLE_CLIENT_ID= | ||
GOOGLE_CLIENT_SECRET= | ||
GOOGLE_TOKEN_URI= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
package jobs | ||
|
||
var JobToImage = map[string]string{ | ||
"seconds-interval": "seconds-interval", | ||
"google-send-email": "gmail", | ||
"timer-seconds-interval": "supervisor-seconds-interval", | ||
"google-send-email": "supervisor-gmail", | ||
} | ||
|
||
var OptArgument = map[string]string{ | ||
"timer-seconds-interval": "", | ||
"google-send-email": "send-email", | ||
} | ||
|
||
func GetImages() []string { | ||
v := make([]string, 0, len(JobToImage)) | ||
|
||
for _, value := range JobToImage { | ||
v = append(v, value) | ||
} | ||
return v | ||
} |
Oops, something went wrong.