Projet

Général

Profil

Development #52137

paramètre à l'API d'import CSV pour faire le traitement asynchrone

Ajouté par Frédéric Péters il y a environ 3 ans. Mis à jour il y a environ 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
17 mars 2021
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Aujourd'hui on a dans l'endpoint un traitement synchrone :

            self.import_csv_submit(get_request().stdin, afterjob=False)

On pourrait permettre un ?async=true&... dans l'URL, pour plutôt avoir la création d'un afterjob, et retourner dans la réponse l'identifiant de celui-ci.

(+ la création d'une API permettant d'obtenir le statut d'exécution d'un afterjob donné).


Fichiers

Révisions associées

Révision 748b70a5 (diff)
Ajouté par Thomas Noël il y a environ 3 ans

api: allow async mode on import-csv cards (#52137)

Révision 96aac2c5 (diff)
Ajouté par Thomas Noël il y a environ 3 ans

api: add jobs endpoint to get afterjobs status (#52137)

Historique

#2

Mis à jour par Thomas Noël il y a environ 3 ans

  • Assigné à mis à Thomas Noël
#3

Mis à jour par Thomas Noël il y a environ 3 ans

  • 0001 : ajout de async=on sur l'API d'import CSV
  • 0002 : ajout de /api/jobs/42 pour connaître l'état de l'afterjob 42 (et référence à cette URL dans le retour de import-csv pour aider un peu)
#4

Mis à jour par Frédéric Péters il y a environ 3 ans

Je serais pour plutôt /api/jobs/42/ (/ final), pour avoir une souplesse sur d'éventuelles évolutions (en pratique avoir AfterJobsDirectory envoyer un nouveau AfterJobDirectory qui aurait une méthode _q_index).

Et que dans la réponse de l'endpoint d'import CSV il y ait toute l'URL pas juste le chemin.(get_publisher().get_frontoffice_url() pour avoir la racine).

#6

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Statut changé de Solution proposée à Solution validée
#7

Mis à jour par Thomas Noël il y a environ 3 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit 96aac2c5e1a21aaa771ebe520bfcd324eb2a9f0c
Author: Thomas NOËL <tnoel@entrouvert.com>
Date:   Wed Mar 17 16:22:05 2021 +0100

    api: add jobs endpoint to get afterjobs status (#52137)

commit 748b70a535cf39b7bbe5922d056fa4ba704e865c
Author: Thomas NOËL <tnoel@entrouvert.com>
Date:   Wed Mar 17 15:28:09 2021 +0100

    api: allow async mode on import-csv cards (#52137)

#8

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF