Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start enriching tenants with Growth plan #2052

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { svc } from '../main'
getMembers is a Temporal activity that retrieves all members available for
enrichment. Member must have one of GitHub username or email address, must not
have been enriched in the past 90 days, and must be part of tenant with a plan
allowing this feature. We limit to 20 members per workflow to not overload
OpenSearch and external APIs.
allowing this feature. We limit to 10 members per workflow to not overload
OpenSearch and external APIs, but mostly to not exceed Temporal result size limit.
*/
export async function getMembers(): Promise<IMember[]> {
let rows: IMember[] = []
Expand All @@ -29,7 +29,7 @@ export async function getMembers(): Promise<IMember[]> {
INNER JOIN tenants ON tenants.id = members."tenantId"
INNER JOIN "memberIdentities" mi ON mi."memberId" = members.id
INNER JOIN activities ON activities."memberId" = members.id
WHERE tenants.plan IN ('Scale', 'Enterprise')
WHERE tenants.plan IN ('Growth', 'Scale', 'Enterprise')
AND (
members."lastEnriched" < NOW() - INTERVAL '90 days'
OR members."lastEnriched" IS NULL
Expand All @@ -42,7 +42,7 @@ export async function getMembers(): Promise<IMember[]> {
AND members."deletedAt" IS NULL
GROUP BY members.id
ORDER BY activity_count DESC
LIMIT 20;`,
LIMIT 10;`,
)
} catch (err) {
throw new Error(err)
Expand Down
Loading