Skip to content

Commit

Permalink
fix: useless calculation as client token was already set
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolife999 committed Dec 4, 2023
1 parent 2b3ce1d commit 26f5c62
Showing 1 changed file with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,9 @@ private String addImage(String tableMetier, int executorConnectionId) throws Arc
public void updatePilotage(String tableSource) throws ArcException {
LoggerHelper.debugAsComment(LOGGER, timestamp, ": ClientDaoImpl.updatePilotage()");

String clientOfTableSource = extractClientFromToken();

StringBuilder query = new StringBuilder();
query.append("UPDATE " + ViewEnum.PILOTAGE_FICHIER.getFullName(environnement) + " T1 ");
query.append("SET client = array_append(client, '" + clientOfTableSource + "') ");
query.append("SET client = array_append(client, '" + this.client + "') ");
query.append(", date_client = array_append( date_client, localtimestamp ) ");
query.append("WHERE true ");
query.append("AND EXISTS (SELECT 1 FROM " + tableSource + " T2 where T1." + ColumnEnum.ID_SOURCE.getColumnName()
Expand All @@ -177,18 +175,6 @@ public void updatePilotage(String tableSource) throws ArcException {
UtilitaireDao.get(0).executeBlock(connection, query.toString());
}

/**
* extract the client token name from the client
*
* @param client2
* @return
*/
private String extractClientFromToken() {
return ManipString.substringBeforeFirst(
ManipString.substringAfterFirst(this.client, Delimiters.SQL_SCHEMA_DELIMITER),
Delimiters.SQL_TOKEN_DELIMITER);
}

public void createTableTrackRetrievedTables() throws ArcException {
ArcPreparedStatementBuilder query = new ArcPreparedStatementBuilder();
query.build(SQL.DROP, SQL.TABLE, SQL.IF_EXISTS, this.tableWsTracking, SQL.END_QUERY);
Expand Down

0 comments on commit 26f5c62

Please sign in to comment.