diff options
Diffstat (limited to 'juick-server/src/main/java/com')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/TwitterManager.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/juick-server/src/main/java/com/juick/server/TwitterManager.java b/juick-server/src/main/java/com/juick/server/TwitterManager.java index d386423b..7d4f8ccc 100644 --- a/juick-server/src/main/java/com/juick/server/TwitterManager.java +++ b/juick-server/src/main/java/com/juick/server/TwitterManager.java @@ -50,16 +50,6 @@ public class TwitterManager { @Value("${twitter_consumer_secret:secret}") private String twitter_consumer_secret; - private ConfigurationBuilder configurationBuilder; - - @PostConstruct - public void init() { - configurationBuilder = new ConfigurationBuilder() - .setDebugEnabled(true) - .setOAuthConsumerKey(twitter_consumer_key) - .setOAuthConsumerSecret(twitter_consumer_secret); - } - @Async @EventListener public void onApplicationEvent(@Nonnull MessageEvent event) { @@ -80,6 +70,10 @@ public class TwitterManager { status = status.substring(0, 254) + "…"; } status += " http://juick.com/" + jmsg.getMid(); + ConfigurationBuilder configurationBuilder = new ConfigurationBuilder() + .setDebugEnabled(true) + .setOAuthConsumerKey(twitter_consumer_key) + .setOAuthConsumerSecret(twitter_consumer_secret); TwitterFactory tf = new TwitterFactory(configurationBuilder .setOAuthAccessToken(t.getToken()) .setOAuthAccessTokenSecret(t.getSecret()).build()); |