Skip to content

Commit a73266f

Browse files
committed
Remove duplicate and unused WorkerState declaration
1 parent 46c4980 commit a73266f

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

Diff for: python/cog/predictor.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
cast,
2121
get_type_hints,
2222
)
23-
from unittest.mock import patch
2423

2524
try:
2625
from typing import get_args, get_origin
2726
except ImportError: # Python < 3.8
2827
from typing_compat import get_args, get_origin # type: ignore
2928

29+
from unittest.mock import patch
30+
3031
import structlog
3132
import yaml
3233
from pydantic import BaseModel, Field, create_model

Diff for: python/cog/server/worker.py

-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import types
99
from collections import defaultdict
1010
from contextvars import ContextVar
11-
from enum import Enum, auto, unique
1211
from multiprocessing.connection import Connection
1312
from typing import Any, AsyncIterator, Callable, Iterator, Optional, TextIO
1413

@@ -42,16 +41,6 @@
4241
_spawn = multiprocessing.get_context("spawn")
4342

4443

45-
@unique
46-
class WorkerState(Enum):
47-
NEW = auto()
48-
STARTING = auto()
49-
IDLE = auto()
50-
PROCESSING = auto()
51-
BUSY = auto()
52-
DEFUNCT = auto()
53-
54-
5544
class Mux:
5645
def __init__(self, terminating: asyncio.Event) -> None:
5746
self.outs: "defaultdict[str, asyncio.Queue[PublicEventType]]" = defaultdict(

0 commit comments

Comments
 (0)