Skip to content

Commit

Permalink
Replace StringTable where feasible
Browse files Browse the repository at this point in the history
AL-128
  • Loading branch information
cccs-rs authored Oct 15, 2020
2 parents c458464 + ebfd8a3 commit 3b35c71
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions assemblyline_service_client/task_handler.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
import copy
import json
import os
import requests
import select
import shutil
import signal
import tempfile
import time
import yaml
from enum import Enum
from json import JSONDecodeError
from typing import Optional

import requests
import yaml

from assemblyline.common.digests import get_sha256_for_file
from assemblyline.common.str_utils import StringTable
from assemblyline.odm.messages.task import Task as ServiceTask
from assemblyline.odm.models.service import Service
from assemblyline_core.server_base import ServerBase

STATUSES = StringTable('STATUSES', [
('INITIALIZING', 0),
('WAITING_FOR_TASK', 1),
('DOWNLOADING_FILE', 2),
('DOWNLOADING_FILE_COMPLETED', 3),
('PROCESSING', 4),
('RESULT_FOUND', 5),
('ERROR_FOUND', 6),
('STOPPING', 7),
])

class STATUSES(Enum):
INITIALIZING = 0
WAITING_FOR_TASK = 1
DOWNLOADING_FILE = 2
DOWNLOADING_FILE_COMPLETED = 3
PROCESSING = 4
RESULT_FOUND = 5
ERROR_FOUND = 6
STOPPING = 7

SHUTDOWN_SECONDS_LIMIT = 10
DEFAULT_API_KEY = 'ThisIsARandomAuthKey...ChangeMe!'
Expand Down

0 comments on commit 3b35c71

Please sign in to comment.