mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-28 09:11:18 +00:00
add delay in hasher and rng
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from flask import Flask, Response
|
||||
import os
|
||||
import socket
|
||||
import time
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@@ -19,6 +20,8 @@ def index():
|
||||
|
||||
@app.route("/<int:how_many_bytes>")
|
||||
def rng(how_many_bytes):
|
||||
# Simulate a little bit of delay
|
||||
time.sleep(0.1)
|
||||
return Response(
|
||||
os.read(urandom, how_many_bytes),
|
||||
content_type="application/octet-stream")
|
||||
|
||||
Reference in New Issue
Block a user