Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Augment license check timeout in licensing example #1931

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .ci/run_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
print(file)
minimum_version_str = get_example_required_minimum_dpf_version(file)
if float(server_version) - float(minimum_version_str) < -0.05:
print(f"Example skipped as it requires DPF {minimum_version_str}.")
print(f"Example skipped as it requires DPF {minimum_version_str}.", flush=True)
continue
try:
out = subprocess.check_output([sys.executable, file])
except subprocess.CalledProcessError as e:
sys.stderr.write(str(e.args))
if e.returncode != 3221225477:
print(out)
print(out, flush=True)
raise e
print("PASS")
print("PASS", flush=True)
1 change: 0 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ jobs:
shell: bash
working-directory: .ci
run: |
echo on
python run_examples.py

- name: "Kill all servers"
Expand Down
2 changes: 1 addition & 1 deletion examples/04-advanced/13-manage_licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
# license increment is used, and for what maximum duration.

# Use the LicenseContextManager to block a specific increment for a limited duration
with dpf.LicenseContextManager(increment_name="preppost", license_timeout_in_seconds=1.0) as lic:
with dpf.LicenseContextManager(increment_name="preppost", license_timeout_in_seconds=5.0) as lic:
# Instantiate the licensed operator
out = op_premium.eval()
print(out)