{"action":"created","issue":{"url":"https://api.github.com/repos/openstax/accounts/issues/161","labels_url":"https://api.github.com/repos/openstax/accounts/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/openstax/accounts/issues/161/comments","events_url":"https://api.github.com/repos/openstax/accounts/issues/161/events","html_url":"https://github.com/openstax/accounts/pull/161","id":63229531,"number":161,"title":"Improve import users task","user":{"login":"karenc","id":153353,"avatar_url":"https://avatars.githubusercontent.com/u/153353?v=3","gravatar_id":"","url":"https://api.github.com/users/karenc","html_url":"https://github.com/karenc","followers_url":"https://api.github.com/users/karenc/followers","following_url":"https://api.github.com/users/karenc/following{/other_user}","gists_url":"https://api.github.com/users/karenc/gists{/gist_id}","starred_url":"https://api.github.com/users/karenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karenc/subscriptions","organizations_url":"https://api.github.com/users/karenc/orgs","repos_url":"https://api.github.com/users/karenc/repos","events_url":"https://api.github.com/users/karenc/events{/privacy}","received_events_url":"https://api.github.com/users/karenc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-20T13:31:36Z","updated_at":"2015-03-20T14:25:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openstax/accounts/pulls/161","html_url":"https://github.com/openstax/accounts/pull/161","diff_url":"https://github.com/openstax/accounts/pull/161.diff","patch_url":"https://github.com/openstax/accounts/pull/161.patch"},"body":"Put a transaction around user creation in import users task\r\n\r\nThis makes the import 2.5 times faster.  I used \"time\" to try importing\r\n1000 users and this is the result:\r\n\r\nImport 1000 users (old):\r\n```\r\nreal    2m8.963s\r\nuser    1m8.610s\r\nsys     0m4.849s\r\n```\r\nImport 1000 users (with transaction):\r\n```\r\nreal    0m51.535s\r\nuser    0m50.315s\r\nsys     0m1.047s\r\n```\r\n\r\n-----\r\n\r\nDisplay a list of apps if APP_ID is not an integer\r\n\r\nFor example, if APP_ID is missing, you will see a message like this:\r\n\r\n```\r\n$ rake accounts:import_users CSV_FILE=users.csv\r\nAPP_ID is invalid.  Here is a list of apps:\r\napp id: 1   app name: OpenStax Exercises   callback: https://exercises-qa1.openstax.org/accounts/auth/openstax/callback\r\napp id: 2   app name: OpenStax Tutor       callback: https://tutor-qa1.openstax.org/accounts/auth/openstax/callback\r\napp id: 3   app name: OpenStax Exchange    callback: https://exchange-qa1.openstax.org/accounts/auth/openstax/callback\r\nrake aborted!\r\nAPP_ID must be an integer\r\n/home/karen/accounts/lib/tasks/import_users.rake:11:in `block (2 levels)\r\nin <top (required)>'\r\n/home/karen/.rvm/gems/ruby-1.9.3-p547@accounts/bin/ruby_executable_hooks:15:in\r\n`eval'\r\n/home/karen/.rvm/gems/ruby-1.9.3-p547@accounts/bin/ruby_executable_hooks:15:in\r\n`<main>'\r\nTasks: TOP => accounts:import_users\r\n(See full trace by running task with --trace)\r\n```\r\n\r\nThis should helper the user choose the right app id.\r\n"},"comment":{"url":"https://api.github.com/repos/openstax/accounts/issues/comments/84030986","html_url":"https://github.com/openstax/accounts/pull/161#issuecomment-84030986","issue_url":"https://api.github.com/repos/openstax/accounts/issues/161","id":84030986,"user":{"login":"karenc","id":153353,"avatar_url":"https://avatars.githubusercontent.com/u/153353?v=3","gravatar_id":"","url":"https://api.github.com/users/karenc","html_url":"https://github.com/karenc","followers_url":"https://api.github.com/users/karenc/followers","following_url":"https://api.github.com/users/karenc/following{/other_user}","gists_url":"https://api.github.com/users/karenc/gists{/gist_id}","starred_url":"https://api.github.com/users/karenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karenc/subscriptions","organizations_url":"https://api.github.com/users/karenc/orgs","repos_url":"https://api.github.com/users/karenc/repos","events_url":"https://api.github.com/users/karenc/events{/privacy}","received_events_url":"https://api.github.com/users/karenc/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T14:25:07Z","updated_at":"2015-03-20T14:25:07Z","body":"Sure I can use the app name instead."}}