Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #31 from wireapp/staging
Browse files Browse the repository at this point in the history
Disable swagger
  • Loading branch information
dkovacevic authored Nov 23, 2022
2 parents be43c3b + 24f0b45 commit 9eb3905
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/wire/bots/recording/MessageHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ void warmup(ClientRepo repo) {
File file = eventProcessor.saveHtml(client, events, filename, false);
Logger.debug("warmed up: %s", file.getName());
Thread.sleep(2 * 1000);
} catch (IOException e) {
Logger.warning("warmup: %s %s.. removing the bot", convId, e);
channelsDAO.delete(convId);
}
}
} catch (Exception e) {
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/wire/bots/recording/Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
import com.wire.xenon.MessageHandlerBase;
import io.dropwizard.Application;
import io.dropwizard.assets.AssetsBundle;
import io.dropwizard.configuration.EnvironmentVariableSubstitutor;
import io.dropwizard.configuration.SubstitutingSourceProvider;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import io.federecio.dropwizard.swagger.SwaggerBundle;
import io.federecio.dropwizard.swagger.SwaggerBundleConfiguration;

import java.util.concurrent.ExecutorService;

Expand All @@ -43,9 +47,11 @@ public static void main(String[] args) throws Exception {

@Override
public void initialize(Bootstrap<Config> bootstrap) {
super.initialize(bootstrap);
String workingDir = System.getProperty("user.dir");

bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)));
bootstrap.addBundle(new AssetsBundle("/scripts", "/scripts", "index.htm", "scripts"));
bootstrap.addBundle(new ImagesBundle(workingDir + "/avatars", "/avatars", "avatars"));
bootstrap.addBundle(new ImagesBundle(workingDir + "/html", "/channel", "channels"));
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/wire/bots/recording/utils/Collector.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ public void add(RemoteMessage event) throws Exception {
}

public void add(OriginMessage message) throws ParseException {
addSystem(message.getName(), message.getTime(), "file-preview", message.getMessageId());
String text = String.format("%s | %s", message.getName(), message.getMimeType());
addSystem(text, message.getTime(), "file-preview", message.getMessageId());
}

public void add(RemoteMessage event, VideoPreviewMessage preview) throws Exception {
Expand Down

0 comments on commit 9eb3905

Please sign in to comment.