Skip to content

Commit 7c681ff

Browse files
Added assign date cache support
1 parent b92c93f commit 7c681ff

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/main/java/org/fugerit/java/github/issue/export/GithubIssueExport.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ private static List<Map> parseJsonData( String data ) throws Exception {
126126
protected static void handle( Properties params ) throws Exception {
127127
GithubIssueInfo info = new GithubIssueInfo(params);
128128
try {
129+
logger.debug( "params "+params );
129130
doHandle( info );
130131
} catch ( Exception e ) {
131132
throw e;
@@ -142,6 +143,7 @@ private static void doHandle( GithubIssueInfo info ) throws Exception {
142143
List<List<String>> lines = new ArrayList<List<String>>();
143144

144145
String cacheMode = info.getProperty( GithubIssueExport.ARG_ASSIGNEE_DATE_MODE, GithubIssueExport.ARG_ASSIGNEE_DATE_MODE_SKIP );
146+
logger.info( "cache-mode : "+cacheMode );
145147

146148
String lang = getLocale( info.getProperty( ARG_LANG ) ).toString();
147149
// data read
@@ -184,9 +186,11 @@ private static void doHandle( GithubIssueInfo info ) throws Exception {
184186
if ( assignee != null ) {
185187
currentLine.add( String.valueOf( assignee.get( "login" ) ) );
186188
String assignDate = null;
187-
if ( activeCache( cacheMode) ) {
189+
boolean activeCache = activeCache( cacheMode);
190+
if ( activeCache ) {
188191
assignDate = info.getCacheEntry( issueId , GithubIssueConfig.FIELD_ASSIGN_DATE );
189192
}
193+
logger.info( "activeCache : "+activeCache+" - issueId:"+issueId+" , assign date "+assignDate );
190194
if ( assignDate == null ) {
191195
if ( "closed".equalsIgnoreCase( state ) && ARG_ASSIGNEE_DATE_MODE_SKIP_CLOSED.equals( cacheMode ) ) {
192196
// just skip
@@ -200,7 +204,7 @@ private static void doHandle( GithubIssueInfo info ) throws Exception {
200204
String eventType = String.valueOf( currentEvent.get( "event" ) );
201205
if ( eventType.equalsIgnoreCase( "assigned" ) ) {
202206
assignDate = String.valueOf( currentEvent.get( "created_at" ) );
203-
if ( activeCache( cacheMode) ) {
207+
if ( activeCache ) {
204208
info.addCacheEntry( issueId , GithubIssueConfig.FIELD_ASSIGN_DATE, assignDate );
205209
}
206210
}

src/main/java/org/fugerit/java/github/issue/export/GithubIssueExportMain.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class GithubIssueExportMain {
2222

2323
public static final String ARG_GUI_LOCALE = "gui_locale";
2424

25+
public static final String ARG_GUI_PRESET_ARG_ASSIGNEE_DATE_MODE = "gui_preset-"+GithubIssueExport.ARG_ASSIGNEE_DATE_MODE;
2526
public static final String ARG_GUI_PRESET_OWNER = "gui_preset-"+GithubIssueExport.ARG_OWNER;
2627
public static final String ARG_GUI_PRESET_REPO = "gui_preset-"+GithubIssueExport.ARG_REPO;
2728
public static final String ARG_GUI_PRESET_PROXY_HOST = "gui_preset-"+GithubIssueExport.ARG_PROXY_HOST;

src/main/java/org/fugerit/java/github/issue/export/GithubIssueGUI.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,14 @@ private void checkPreset( Properties params, String key, JTextField field ) {
290290
public GithubIssueGUI( Properties params ) {
291291
super( "GITHUB ISSUE EXPORT GUI" );
292292
this.initConf();
293-
System.out.println( params );
294293
this.checkPreset( params , GithubIssueExportMain.ARG_GUI_PRESET_OWNER, this.inputRepoOwner );
295294
this.checkPreset( params , GithubIssueExportMain.ARG_GUI_PRESET_REPO, this.inputRepoName );
296295
this.checkPreset( params , GithubIssueExportMain.ARG_GUI_PRESET_PROXY_HOST, this.inputProxyHost );
297296
this.checkPreset( params , GithubIssueExportMain.ARG_GUI_PRESET_PROXY_PORT, this.inputProxyPort );
297+
String presetCacheMode = params.getProperty( GithubIssueExportMain.ARG_GUI_PRESET_ARG_ASSIGNEE_DATE_MODE );
298+
if ( presetCacheMode != null ) {
299+
this.config.setProperty( GithubIssueExport.ARG_ASSIGNEE_DATE_MODE , presetCacheMode );
300+
}
298301
this.initLayout();
299302
}
300303

0 commit comments

Comments
 (0)