Skip to content

Commit

Permalink
fix: allow offline mode to have either tokens or client-tokens set
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswk committed Sep 21, 2024
1 parent 1090b3b commit 429ae00
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions benchmarks/singlefeatureendpoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import http from 'k6/http';

import { sleep } from 'k6';

export const options = {
duration: '10s',
vus: 50,
thresholds: {
http_req_failed: ['rate<0.01'],
http_req_duration: ['p(95)<10'] // (95th percentile should be < 10 ms)
}
};

export default function () {
http.get('http://127.0.0.1:3063/api/frontend/Eda', { 'headers': { 'Authorization': `${__ENV.TOKEN}` } });
}
2 changes: 1 addition & 1 deletion server/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub(crate) fn build_offline_mode(
}

fn build_offline(offline_args: OfflineArgs) -> EdgeResult<CacheContainer> {
if offline_args.tokens.is_empty() {
if offline_args.tokens.is_empty() && offline_args.client_tokens.is_empty() {
return Err(EdgeError::NoTokens(
"No tokens provided. Tokens must be specified when running in offline mode".into(),
));
Expand Down

0 comments on commit 429ae00

Please sign in to comment.