hyperlog-core / hyperlog-backend

Backend for hyperlog
0 stars 0 forks source link

Add analyse mutation #63

Closed BrainBuzzer closed 4 years ago

BrainBuzzer commented 4 years ago

This mutation needs to do the following things:

  1. Store how many times the mutation has been run. If above 5, the mutation should return an error.
  2. Check if there is analyse task already running. This is done by fetching the data from DynamoDB table previously created. It will have a field called status which if says in_progress, the mutation should return response that function is already running.
  3. If both of the above conditions are checked, then send a message to SQS queue with messageAttribute called github_token which will be of type string.
nikochiko commented 4 years ago

Will the analysis status will be stored in the same table as other profile data (with user_id as primary key and github_access_token as other field - see ref)? If that is the case, perhaps we can push the user_id (or both user_id and token) to SQS since that is the primary key and the lambda function can make an update on dynamodb with that.

BrainBuzzer commented 4 years ago

Analysis status will be stored in the same table referenced in backend. Analysed profile of the user will be in other table. And it makes sense to send both UUID and token to the sqs queue. So go ahead with that. Just send them as message attributes instead of body.

nikochiko commented 4 years ago

Aha. Got it