Skip to content

Commit

Permalink
Accept parameters for gql cache
Browse files Browse the repository at this point in the history
  • Loading branch information
fserena committed Sep 17, 2018
1 parent 8ec3743 commit ba64f42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion agora_cli/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.0.10",
"version": "0.0.11",
"author": "Fernando Serena",
"email": "kudhmud@gmail.com",
"github": "https://github.com/fserena/agora-cli",
Expand Down
8 changes: 5 additions & 3 deletions agora_cli/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,13 @@ def publish_ui(ctx, query, incremental, ignore_cycles, cache_file, cache_host, c
@click.option('--cache-db')
@click.option('--resource-cache', is_flag=True, default=False)
@click.option('--fragment-cache', is_flag=True, default=False)
@click.option('--age-gql-cache', type=int, default=300)
@click.option('--len-gql-cache', type=int, default=1000000)
@click.option('--host', default='agora')
@click.option('--port', default=80)
@click.pass_context
def publish_gql(ctx, schema_file, ignore_cycles, cache_file, cache_host, cache_port, cache_db, resource_cache,
fragment_cache, host,
port):
fragment_cache, age_gql_cache, len_gql_cache, host, port):
check_init(ctx)

if cache_file:
Expand All @@ -288,7 +289,8 @@ def publish_gql(ctx, schema_file, ignore_cycles, cache_file, cache_host, cache_p

ctx.obj['gw'].data_cache = cache
gql_processor = GraphQLProcessor(ctx.obj['gw'], schema_path=schema_file, scholar=fragment_cache, server_name=host,
port=80, follow_cycles=not ignore_cycles, base='.agora/store/fragments')
port=80, follow_cycles=not ignore_cycles, base='.agora/store/fragments',
data_gw_cache={'max_age_seconds': age_gql_cache, 'max_len': len_gql_cache})

app.add_url_rule('/graphql',
view_func=AgoraGraphQLView.as_view('graphql', schema=gql_processor.schema,
Expand Down

0 comments on commit ba64f42

Please sign in to comment.