fix: digest send async
This commit is contained in:
parent
5d76475801
commit
7ac99e8259
|
|
@ -16,6 +16,11 @@ export class EmailActivity {
|
|||
return this._emailService.sendEmailSync(to, subject, html, replyTo);
|
||||
}
|
||||
|
||||
@ActivityMethod()
|
||||
async sendEmailAsync(to: string, subject: string, html: string, replyTo?: string) {
|
||||
return this._emailService.sendEmail(to, subject, html, replyTo);
|
||||
}
|
||||
|
||||
@ActivityMethod()
|
||||
async getUserOrgs(id: string) {
|
||||
return this._organizationService.getTeam(id);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import {
|
|||
import { Email, emailSignal } from '@gitroom/orchestrator/signals/email.signal';
|
||||
import { EmailActivity } from '@gitroom/orchestrator/activities/email.activity';
|
||||
|
||||
const { sendEmail, getUserOrgs } = proxyActivities<EmailActivity>({
|
||||
const { getUserOrgs, sendEmailAsync } = proxyActivities<EmailActivity>({
|
||||
startToCloseTimeout: '10 minute',
|
||||
taskQueue: 'main',
|
||||
retry: {
|
||||
|
|
@ -52,7 +52,7 @@ export async function digestEmailWorkflow({
|
|||
|
||||
if (toSend.length === 0) continue;
|
||||
|
||||
await sendEmail(
|
||||
await sendEmailAsync(
|
||||
user.user.email,
|
||||
toSend.length === 1
|
||||
? toSend[0].title
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@ const { sendEmail } = proxyActivities<EmailActivity>({
|
|||
},
|
||||
});
|
||||
|
||||
// Rate limit: 2 requests per second = 500ms between requests
|
||||
const RATE_LIMIT_MS = 500;
|
||||
const RATE_LIMIT_MS = 700;
|
||||
|
||||
export async function sendEmailWorkflow({
|
||||
queue = [],
|
||||
|
|
|
|||
|
|
@ -444,7 +444,6 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider {
|
|||
integration: Integration
|
||||
): Promise<PostResponse[]> {
|
||||
const [firstPost] = postDetails;
|
||||
console.log('hello');
|
||||
const isPhoto = (firstPost?.media?.[0]?.path?.indexOf('mp4') || -1) === -1;
|
||||
const {
|
||||
data: { publish_id },
|
||||
|
|
|
|||
Loading…
Reference in New Issue