mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: Fix benchmark script
Following a recent commit (cb4b8146a30cd94b04db1b662fbebdb8021a7771), the benchmark script wasn’t working anymore (and the related rake task). This patch fixes it. It also adds some information about Ruby YJIT being enabled or not.
This commit is contained in:

committed by
Loïc Guitaut

parent
5563e9dc03
commit
581fb97bfa
@ -13,15 +13,15 @@ task "user_api_key:create", [:username] => :environment do |task, args|
|
||||
|
||||
application_name = "perf test application"
|
||||
|
||||
user_api_key = UserApiKey.where(application_name: application_name).destroy_all
|
||||
UserApiKeyClient.where(application_name: application_name).destroy_all
|
||||
|
||||
user_api_key =
|
||||
UserApiKey.create!(
|
||||
application_name: application_name,
|
||||
client_id: "1234",
|
||||
scopes: ["read"].map { |name| UserApiKeyScope.new(name: name) },
|
||||
user_id: user.id,
|
||||
)
|
||||
|
||||
puts user_api_key.key
|
||||
UserApiKeyClient
|
||||
.create!(client_id: "1234", application_name:)
|
||||
.then do |client|
|
||||
client.keys.create!(
|
||||
scopes: ["read"].map { |name| UserApiKeyScope.new(name:) },
|
||||
user_id: user.id,
|
||||
)
|
||||
end
|
||||
.then { |user_api_key| puts user_api_key.key }
|
||||
end
|
||||
|
Reference in New Issue
Block a user