Skip to content

Commit

Permalink
switching back to the while=True loop
Browse files Browse the repository at this point in the history
  • Loading branch information
vrbanecd committed Jan 16, 2025
1 parent eee9c0a commit b459d88
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions teapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,25 +756,30 @@ async def storm_webdav_state(state, condition, user):

should_start_sw = False
logger.info("Assesing the state of the storm webdav instance for user %s", user)

async with condition:
while not (state[user] == "NOT RUNNING" or state[user] == "RUNNING"):
if user not in state:
state[user] = "NOT_RUNNING"
logger.info(
"Currently, there is no storm webdav instance running for user %s", user
)
if user not in state:
state[user] = "NOT_RUNNING"
logger.info(
"Currently, there is no storm webdav instance running for user %s",
user,
)

while True:
if state[user] == "NOT_RUNNING":
state[user] = "STARTING"
condition.notify()
should_start_sw = True
break

elif state[user] == "RUNNING":
async with app.state.state_lock:
app.state.session_state[user]["last_accessed"] = str(
datetime.datetime.now()
)
should_start_sw = False
break

else:
await condition.wait()

Expand Down

1 comment on commit b459d88

@vrbanecd
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
32 0 0 32 100 54.364684s

Passed Tests

Name ⏱️ Duration Suite
GET USER1 10.557 s Teapot-Tests
GET USER2 9.622 s Teapot-Tests
GET NO TOKEN 0.010 s Teapot-Tests
GET INVALID TOKEN 0.035 s Teapot-Tests
PUT REQUEST INVALID TOKEN 0.009 s Teapot-Tests
PUT REQUEST NO TOKEN 0.009 s Teapot-Tests
PUT REQUEST USER1 2.233 s Teapot-Tests
PUT REQUEST USER2 2.170 s Teapot-Tests
GET FILE USER1 3.186 s Teapot-Tests
GET FILE USER2 3.195 s Teapot-Tests
GET FILE NO TOKEN 0.013 s Teapot-Tests
GET FILE INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST USER1 2.117 s Teapot-Tests
DELETE REQUEST USER2 2.127 s Teapot-Tests
DELETE REQUEST INVALID TOKEN 0.011 s Teapot-Tests
DELETE REQUEST NO TOKEN 0.010 s Teapot-Tests
GET USER1 EXTRA_AREA 2.100 s Teapot-Tests
GET USER2 EXTRA_AREA 2.109 s Teapot-Tests
GET NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests
GET INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST NO TOKEN EXTRA_AREA 0.008 s Teapot-Tests
PUT REQUEST USER1 EXTRA_AREA 2.116 s Teapot-Tests
PUT REQUEST USER2 EXTRA_AREA 2.137 s Teapot-Tests
GET FILE USER1 EXTRA_AREA 3.159 s Teapot-Tests
GET FILE USER2 EXTRA_AREA 3.161 s Teapot-Tests
GET FILE NO TOKEN EXTRA_AREA 0.010 s Teapot-Tests
GET FILE INVALID TOKEN EXTRA_AREA 0.008 s Teapot-Tests
DELETE REQUEST USER1 EXTRA_AREA 2.091 s Teapot-Tests
DELETE REQUEST USER2 EXTRA_AREA 2.105 s Teapot-Tests
DELETE REQUEST INVALID TOKEN EXTRA_AREA 0.010 s Teapot-Tests
DELETE REQUEST NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests

Please sign in to comment.