<commit_before>package com.lance.websocket.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

import com.lance.websocket.service.EchoService;
import com.lance.websocket.service.EchoServiceImpl;

@Configuration
public class WebSocketConfig implements WebSocketConfigurer{

	@Override
	public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
		registry.addHandler(echoWebSocketHandler(), "/echo").setAllowedOrigins("*").withSockJS();
	}
	
	@Bean
	public WebSocketHandler echoWebSocketHandler() {
		return new EchoWebSocketHandler(echoService());
	}
	
	@Bean
	public EchoService echoService() {
		return new EchoServiceImpl("Did you say \"%s\"?");
	}
}
<commit_msg>update sockjs heartbeat 30s<commit_after>package com.lance.websocket.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

import com.lance.websocket.service.EchoService;
import com.lance.websocket.service.EchoServiceImpl;

@Configuration
public class WebSocketConfig implements WebSocketConfigurer{

	@Override
	public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
		registry.addHandler(echoWebSocketHandler(), "/echo")
				.setAllowedOrigins("*")
				.withSockJS()
				.setHeartbeatTime(30000)
				.setSessionCookieNeeded(true);
	}
	
	@Bean
	public WebSocketHandler echoWebSocketHandler() {
		return new EchoWebSocketHandler(echoService());
	}
	
	@Bean
	public EchoService echoService() {
		return new EchoServiceImpl("Did you say \"%s\"?");
	}
}

{'fraction_non_alphanumeric': 0.10084033613445378, 'fraction_numerical': 0.0034602076124567475, 'mean_word_length': 6.7846153846153845, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2657546', 'n_tokens_mistral': 611, 'n_tokens_neox': 563, 'n_words': 99}