Skip to content

Commit

Permalink
Bump spanner stale read from 10 to 15 seconds. [(googleapis#1207)](Go…
Browse files Browse the repository at this point in the history
…ogleCloudPlatform/python-docs-samples#1207)

At the request of the spanner team.
  • Loading branch information
SurferJeffAtGoogle authored and Jon Wayne Parrott committed Nov 9, 2017
1 parent dae800f commit 0af87b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions samples/samples/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ def read_data(instance_id, database_id):


def read_stale_data(instance_id, database_id):
"""Reads sample data from the database. The data is exactly 10 seconds
"""Reads sample data from the database. The data is exactly 15 seconds
stale."""
import datetime

spanner_client = spanner.Client()
instance = spanner_client.instance(instance_id)
database = instance.database(database_id)
staleness = datetime.timedelta(seconds=10)
staleness = datetime.timedelta(seconds=15)

with database.snapshot(exact_staleness=staleness) as snapshot:
keyset = spanner.KeySet(all_=True)
Expand Down
2 changes: 1 addition & 1 deletion samples/samples/snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_read_stale_data(temporary_database, capsys):
out, _ = capsys.readouterr()

# It shouldn't be in the output because it was *just* inserted by the
# temporary database fixture and this sample reads 10 seconds into the
# temporary database fixture and this sample reads 15 seconds into the
# past.
assert 'Total Junk' not in out

Expand Down

0 comments on commit 0af87b2

Please sign in to comment.