Skip to content

Commit 35cf935

Browse files
committed
LITE-30133 Force upload action can not create schedule task
1 parent 2d65764 commit 35cf935

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

connect_bi_reporter/uploads/api/views.py

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
from connect.eaas.core.decorators import router
77
from connect.eaas.core.inject.common import get_call_context, get_logger
88
from connect.eaas.core.inject.models import Context
9-
from connect.eaas.core.inject.synchronous import get_installation, get_installation_client
9+
from connect.eaas.core.inject.synchronous import (
10+
get_extension_client,
11+
get_installation,
12+
get_installation_client,
13+
)
1014
from connect_extension_utils.api.pagination import apply_pagination, PaginationParams
1115
from connect_extension_utils.db.models import get_db, VerboseBaseSession
1216

@@ -71,18 +75,27 @@ def get_retry_upload(
7175
feed_id: str,
7276
upload_id: str,
7377
db: VerboseBaseSession = Depends(get_db),
74-
client: ConnectClient = Depends(get_installation_client),
78+
extension_client: ConnectClient = Depends(get_extension_client),
7579
context: Context = Depends(get_call_context),
7680
logger: Logger = Depends(get_logger),
7781
installation: dict = Depends(get_installation),
7882
):
79-
scheduler = Scheduler(client, context, logger)
83+
scheduler = Scheduler(extension_client, context, logger)
8084
upload = retry_failed_upload(db, installation, feed_id, upload_id, scheduler)
8185
return map_to_upload_schema(upload)
8286

83-
def _force_upload(self, db, client, context, logger, installation, feed):
84-
scheduler = Scheduler(client, context, logger)
85-
upload = force_upload(db, client, scheduler, installation, feed)
87+
def _force_upload(
88+
self,
89+
db,
90+
extension_client,
91+
installation_client,
92+
context,
93+
logger,
94+
installation,
95+
feed,
96+
):
97+
scheduler = Scheduler(extension_client, context, logger)
98+
upload = force_upload(db, installation_client, scheduler, installation, feed)
8699
return map_to_upload_schema(upload)
87100

88101
@router.post(
@@ -95,10 +108,19 @@ def force_upload(
95108
self,
96109
feed_id: str,
97110
db: VerboseBaseSession = Depends(get_db),
98-
client: ConnectClient = Depends(get_installation_client),
111+
extension_client: ConnectClient = Depends(get_extension_client),
112+
installation_client: ConnectClient = Depends(get_installation_client),
99113
context: Context = Depends(get_call_context),
100114
logger: Logger = Depends(get_logger),
101115
installation: dict = Depends(get_installation),
102116
):
103117
feed = get_feed_for_uploads(db, installation, feed_id)
104-
return self._force_upload(db, client, context, logger, installation, feed)
118+
return self._force_upload(
119+
db,
120+
extension_client,
121+
installation_client,
122+
context,
123+
logger,
124+
installation,
125+
feed,
126+
)

0 commit comments

Comments
 (0)