-
Notifications
You must be signed in to change notification settings - Fork 23
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
[WIP] Update to official Amazon SDK #97
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ejolly this uses the https://github.com/peerlibrary/meteor-aws-sdk package (@mitar does good work) to call AWS instead of the old janky stuff. It still needs a bunch of work though, see comments.
I could use your help to go through and modify all the TurkServer.mturk()
calls appropriately and test them. That should allow you to run your existing experiment.
The lack of TypeScript means we have to basically check and test everything manually instead of getting the data shape checked for us.
admin/admin.js
Outdated
@@ -213,7 +213,7 @@ Meteor.methods({ | |||
"ts-admin-account-balance"() { | |||
TurkServer.checkAdmin(); | |||
try { | |||
return TurkServer.mturk("GetAccountBalance", {}); | |||
return TurkServer.mturk.getAccountBalanceSync().AvailableBalance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every Turkserver.mturk
in the codebase now needs to be replaced with this direct JavaScript function variant instead. Note in particular that peerlibrary:aws-sdk
conveniently provides a ...Sync()
variant of the function that works with Meteor's fibers, so the call looks synchronous (even though it is in fact a callback under the hood).
switch (op) { | ||
case "CreateHIT": | ||
return JSPath.apply("..HITId[0]", result); | ||
case "GetAccountBalance": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old AWS SDK used to be all XML-based, which means we have this ugly parser stuff. We can remove all that now and access the JSON data directly, but note that this will have to be added to each TurkServer.mturk
call as in the example code above.
@ejolly see your question at peerlibrary/meteor-aws-sdk#38 |
cc @ejolly.