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

feat: env variable for infinite discovery use internal tracking of seen artworks #6454

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions _schemaV2.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -17340,9 +17340,6 @@ type Query {

# Weights for the KNN and MLT query
osWeights: [Float] = [0.6, 0.4]

# Internal Redis tracking for the user seen artworks
useInternalTracking: Boolean = false
): ArtworkConnection

# A namespace external partners (provided by Galaxy)
Expand Down Expand Up @@ -22098,9 +22095,6 @@ type Viewer {

# Weights for the KNN and MLT query
osWeights: [Float] = [0.6, 0.4]

# Internal Redis tracking for the user seen artworks
useInternalTracking: Boolean = false
): ArtworkConnection

# A namespace external partners (provided by Galaxy)
Expand Down
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const {
EMBEDLY_KEY,
ENABLE_ASYNC_STACK_TRACES,
ENABLE_GEOLOCATION_LOGGING,
ENABLE_INFINITE_DISCOVERY_INTERNAL_TRACKING,
ENABLE_IP_BASED_LOCATION,
ENABLE_METRICS,
ENABLE_QUERY_TRACING,
Expand Down Expand Up @@ -157,6 +158,8 @@ export default {
EMBEDLY_ENDPOINT,
EMBEDLY_KEY,
ENABLE_ASYNC_STACK_TRACES,
ENABLE_INFINITE_DISCOVERY_INTERNAL_TRACKING:
ENABLE_INFINITE_DISCOVERY_INTERNAL_TRACKING === "true",
ENABLE_IP_BASED_LOCATION: ENABLE_IP_BASED_LOCATION === "true",
ENABLE_METRICS,
ENABLE_GEOLOCATION_LOGGING: ENABLE_GEOLOCATION_LOGGING === "true",
Expand Down
9 changes: 2 additions & 7 deletions src/schema/v2/infiniteDiscovery/discoverArtworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import {
GraphQLInt,
GraphQLFloat,
GraphQLList,
GraphQLBoolean,
} from "graphql"
import { ResolverContext } from "types/graphql"
import { artworkConnection } from "../artwork"
import { connectionFromArray } from "graphql-relay"
import { pageable } from "relay-cursor-paging"
import config from "config"

export const DiscoverArtworks: GraphQLFieldConfig<void, ResolverContext> = {
type: artworkConnection.connectionType,
Expand All @@ -19,11 +19,6 @@ export const DiscoverArtworks: GraphQLFieldConfig<void, ResolverContext> = {
type: new GraphQLList(GraphQLString),
description: "Exclude these artworks from the response",
},
useInternalTracking: {
type: GraphQLBoolean,
description: "Internal Redis tracking for the user seen artworks",
defaultValue: false,
},
mltFields: {
type: new GraphQLList(GraphQLString),
description: "These fields are used for More Like This query",
Expand Down Expand Up @@ -58,7 +53,7 @@ export const DiscoverArtworks: GraphQLFieldConfig<void, ResolverContext> = {
os_weights: args.osWeights,
curated_picks_size: args.curatedPicksSize,
user_id: userID,
use_internal_tracking: args.useInternalTracking,
use_internal_tracking: config.ENABLE_INFINITE_DISCOVERY_INTERNAL_TRACKING,
}

const gravityResponse = await artworksDiscoveryLoader(gravityArgs)
Expand Down