Changeset 0cee758


Ignore:
Timestamp:
Jan 15, 2012 9:30:15 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
da2cd92
Parents:
fc6f4ec
Message:
  • Only stop a plugin at shutdown if it was running
File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/PluginStopper.java

    rfc6f4ec r0cee758  
    55
    66/**
    7  *  Stop all plugins that are installed
     7 *  Stop all plugins that are installed and running
    88 *
    99 *  @since 0.7.13
     
    2222
    2323    /**
    24      *  Stop all plugins
    25      *  (whether or not they were ever started)
     24     *  Stop all running plugins
    2625     *
    2726     *  this shouldn't throw anything
    2827     */
    29     static void stopPlugins(RouterContext ctx) {
     28    private static void stopPlugins(RouterContext ctx) {
    3029        Log log = ctx.logManager().getLog(PluginStopper.class);
    3130        for (String app : getPlugins()) {
    32             try {
    33                stopPlugin(ctx, app);
    34             } catch (Throwable e) {
    35                if (log.shouldLog(Log.WARN))
    36                    log.warn("Failed to stop plugin: " + app, e);
     31            if (isPluginRunning(app, ctx)) {
     32                try {
     33                   stopPlugin(ctx, app);
     34                } catch (Throwable e) {
     35                   if (log.shouldLog(Log.WARN))
     36                       log.warn("Failed to stop plugin: " + app, e);
     37                }
    3738            }
    3839        }
Note: See TracChangeset for help on using the changeset viewer.